Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(610)

Unified Diff: skia/ext/bitmap_platform_device_win.h

Issue 1963713002: Replace setMatrixClip() with BeginPlatformPaint() logic (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: compensate for any outstanding saveLayer() calls Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « skia/ext/bitmap_platform_device_skia.cc ('k') | skia/ext/bitmap_platform_device_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/bitmap_platform_device_win.h
diff --git a/skia/ext/bitmap_platform_device_win.h b/skia/ext/bitmap_platform_device_win.h
index 911d0d73a058d4a4b7d17df87b747d1a51827304..1a910be6f31c206dc467699f34ddebb2b49c9fbd 100644
--- a/skia/ext/bitmap_platform_device_win.h
+++ b/skia/ext/bitmap_platform_device_win.h
@@ -39,13 +39,8 @@ class SK_API BitmapPlatformDevice : public SkBitmapDevice, public PlatformDevice
~BitmapPlatformDevice() override;
- // Loads (lazily) the given transform and clipping region into the HDC. This
- // is overridden from SkBaseDevice, where it is deprecated.
- void setMatrixClip(const SkMatrix& transform,
- const SkRegion& region,
- const SkClipStack&) override;
-
- void DrawToHDC(HDC dc, int x, int y, const RECT* src_rect) override;
+ void DrawToHDC(HDC source_dc, HDC destination_dc, int x, int y,
+ const RECT* src_rect, const SkMatrix& transform) override;
protected:
// Flushes the Windows device context so that the pixel data can be accessed
@@ -59,7 +54,8 @@ class SK_API BitmapPlatformDevice : public SkBitmapDevice, public PlatformDevice
// PlatformDevice override
// Retrieves the bitmap DC, which is the memory DC for our bitmap data. The
// bitmap DC may be lazily created.
- PlatformSurface BeginPlatformPaint() override;
+ PlatformSurface BeginPlatformPaint(const SkMatrix& transform,
+ const SkIRect& clip_bounds) override;
// Private constructor.
BitmapPlatformDevice(HBITMAP hbitmap, const SkBitmap& bitmap);
@@ -76,32 +72,14 @@ class SK_API BitmapPlatformDevice : public SkBitmapDevice, public PlatformDevice
// Lazily-created DC used to draw into the bitmap; see GetBitmapDC().
HDC hdc_;
- // True when there is a transform or clip that has not been set to the
- // context. The context is retrieved for every text operation, and the
- // transform and clip do not change as much. We can save time by not loading
- // the clip and transform for every one.
- bool config_dirty_;
-
- // Translation assigned to the context: we need to keep track of this
- // separately so it can be updated even if the context isn't created yet.
- SkMatrix transform_;
-
- // The current clipping region.
- SkRegion clip_region_;
-
// Create/destroy hdc_, which is the memory DC for our bitmap data.
- HDC GetBitmapDC();
+ HDC GetBitmapDC(const SkMatrix& transform, const SkIRect& clip_bounds);
void ReleaseBitmapDC();
bool IsBitmapDCCreated() const;
- // Sets the transform and clip operations. This will not update the DC,
- // but will mark the config as dirty. The next call of LoadConfig will
- // pick up these changes.
- void SetMatrixClip(const SkMatrix& transform, const SkRegion& region);
-
// Loads the current transform and clip into the context. Can be called even
// when |hbitmap_| is NULL (will be a NOP).
- void LoadConfig();
+ void LoadConfig(const SkMatrix& transform, const SkIRect& clip_bounds);
DISALLOW_COPY_AND_ASSIGN(BitmapPlatformDevice);
friend class ScopedPlatformPaint;
« no previous file with comments | « skia/ext/bitmap_platform_device_skia.cc ('k') | skia/ext/bitmap_platform_device_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698