summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--skia/ext/platform_canvas.cc8
-rw-r--r--skia/ext/platform_canvas.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/skia/ext/platform_canvas.cc b/skia/ext/platform_canvas.cc
index 36f0e94..1ba6313 100644
--- a/skia/ext/platform_canvas.cc
+++ b/skia/ext/platform_canvas.cc
@@ -45,6 +45,14 @@ SkCanvas* CreateBitmapCanvas(int width, int height, bool is_opaque) {
return new PlatformCanvas(width, height, is_opaque);
}
+bool SupportsPlatformPaint(const SkCanvas* canvas) {
+ // All of our devices should be our special PlatformDevice.
+ PlatformDevice* device = static_cast<PlatformDevice*>(canvas->getDevice());
+ // TODO(alokp): Rename PlatformDevice::IsNativeFontRenderingAllowed after
+ // removing these calls from WebKit.
+ return device->IsNativeFontRenderingAllowed();
+}
+
PlatformDevice::PlatformSurface BeginPlatformPaint(SkCanvas* canvas) {
// All of our devices should be our special PlatformDevice.
PlatformDevice* device = static_cast<PlatformDevice*>(canvas->getDevice());
diff --git a/skia/ext/platform_canvas.h b/skia/ext/platform_canvas.h
index c4d9222..24f613a 100644
--- a/skia/ext/platform_canvas.h
+++ b/skia/ext/platform_canvas.h
@@ -119,6 +119,11 @@ class SK_API PlatformCanvas : public SkCanvas {
// transparency: this will enable some optimizations.
SK_API SkCanvas* CreateBitmapCanvas(int width, int height, bool is_opaque);
+// Returns true if native platform routines can be used to draw on the
+// given canvas. If this function returns false, BeginPlatformPaint will
+// 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.
//