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

Unified Diff: skia/ext/platform_device.h

Issue 10915065: Add PlatformPictureSkia and RecordingPlatformDeviceSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And one more.. Created 8 years, 3 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
Index: skia/ext/platform_device.h
diff --git a/skia/ext/platform_device.h b/skia/ext/platform_device.h
index 69efb3f723356896f234cf0ae767a804ffc060ca..f566ebaa630d719020736606741492a85d4c3c48 100644
--- a/skia/ext/platform_device.h
+++ b/skia/ext/platform_device.h
@@ -96,6 +96,26 @@ SK_API bool IsPreviewMetafile(const SkCanvas& canvas);
// provide to allow for drawing by the native platform into the device.
class SK_API PlatformDevice {
public:
+ enum PlatformPaint {
+ //
+ // PlatformPaint Support
+ //
+ // Platform specific paint operations can not be used to draw on the
+ // given canvas. BeginPlatformPaint will return NULL PlatformSurface.
+ PLATFORM_PAINT_UNSUPPORTED = 0,
+
+ // Platform specific paint operations can be used to draw on the given
+ // canvas without causing an intermediate bitmap to be created.
+ PLATFORM_PAINT_DIRECT,
+
+ // Platform specific paint operations can be used to draw on the given
+ // canvas but it might cause an intermediate bitmap to be created.
+ // Allocating and setting up an intermediate bitmap can be expensive.
+ // It is recommended to avoid using platform paint if possible when
+ // platform paint support is indirect.
+ PLATFORM_PAINT_INDIRECT
+ };
+
virtual ~PlatformDevice() {}
#if defined(OS_MACOSX)
@@ -121,8 +141,8 @@ class SK_API PlatformDevice {
virtual void DrawToNativeContext(PlatformSurface surface, int x, int y,
const PlatformRect* src_rect) = 0;
- // Returns true if GDI operations can be used for drawing into the bitmap.
- virtual bool SupportsPlatformPaint();
+ // Returns support for platform specific paint operations.
+ virtual PlatformPaint PlatformPaintSupport();
#if defined(OS_WIN)
// Loads a SkPath into the GDI context. The path can there after be used for

Powered by Google App Engine
This is Rietveld 408576698