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

Unified Diff: skia/ext/platform_canvas.h

Issue 1839113002: Limit manual control of platform painting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Privatize Created 4 years, 9 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_win.cc ('k') | skia/ext/platform_canvas.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/platform_canvas.h
diff --git a/skia/ext/platform_canvas.h b/skia/ext/platform_canvas.h
index 3def7ae3f33df55d35e70d2cc3f3dbe34547a304..8455261e90a17268dda73dbd567e27e28e0e68d2 100644
--- a/skia/ext/platform_canvas.h
+++ b/skia/ext/platform_canvas.h
@@ -145,27 +145,16 @@ SK_API bool GetWritablePixels(SkCanvas* canvas, SkPixmap* pixmap);
// return NULL PlatformSurface.
SK_API bool SupportsPlatformPaint(const SkCanvas* canvas);
-// These calls should surround calls to platform drawing routines, the
-// surface returned here can be used with the native platform routines.
-//
-// Call EndPlatformPaint when you are done and want to use skia operations
-// after calling the platform-specific BeginPlatformPaint; this will
-// synchronize the bitmap to OS if necessary.
-SK_API PlatformSurface BeginPlatformPaint(SkCanvas* canvas);
-SK_API void EndPlatformPaint(SkCanvas* canvas);
-
-// Helper class for pairing calls to BeginPlatformPaint and EndPlatformPaint.
-// Upon construction invokes BeginPlatformPaint, and upon destruction invokes
-// EndPlatformPaint.
+// This object guards calls to platform drawing routines. The surface
+// returned from GetPlatformSurface() can be used with the native platform
+// routines.
class SK_API ScopedPlatformPaint {
public:
- explicit ScopedPlatformPaint(SkCanvas* canvas) : canvas_(canvas) {
- platform_surface_ = BeginPlatformPaint(canvas);
- }
- ~ScopedPlatformPaint() { EndPlatformPaint(canvas_); }
+ explicit ScopedPlatformPaint(SkCanvas* canvas);
// Returns the PlatformSurface to use for native platform drawing calls.
PlatformSurface GetPlatformSurface() { return platform_surface_; }
+
private:
SkCanvas* canvas_;
PlatformSurface platform_surface_;
« no previous file with comments | « skia/ext/bitmap_platform_device_win.cc ('k') | skia/ext/platform_canvas.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698