Fix pixeldated HiDPI Mac widgets with impl-side painting
Allow SkiaBitLockers to specify that they should record a bitmap at
a specified scale. Callers that know that they will be replayed at a
given scale factor can specify the final scale during record.
BUG=408557
Review URL: https://codereview.chromium.org/611253004
Cr-Commit-Position: refs/heads/master@{#297485}
diff --git a/skia/ext/skia_utils_mac.h b/skia/ext/skia_utils_mac.h
index e087867..b60f9e8 100644
--- a/skia/ext/skia_utils_mac.h
+++ b/skia/ext/skia_utils_mac.h
@@ -108,8 +108,11 @@
// Converts a SkCanvas temporarily to a CGContext
class SK_API SkiaBitLocker {
public:
+ // TODO(ccameron): delete this constructor
explicit SkiaBitLocker(SkCanvas* canvas);
- SkiaBitLocker(SkCanvas* canvas, const SkIRect& userClipRect);
+ SkiaBitLocker(SkCanvas* canvas,
+ const SkIRect& userClipRect,
+ SkScalar bitmapScaleFactor = 1);
~SkiaBitLocker();
CGContextRef cgContext();
bool hasEmptyClipRegion() const;
@@ -128,6 +131,7 @@
CGContextRef cgContext_;
SkBitmap bitmap_;
SkIPoint bitmapOffset_;
+ SkScalar bitmapScaleFactor_;
// True if we are drawing to |canvas_|'s SkBaseDevice's bits directly through
// |bitmap_|. Otherwise, the bits in |bitmap_| are our allocation and need to