summaryrefslogtreecommitdiffstats
path: root/skia
diff options
context:
space:
mode:
authoralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 16:16:49 +0000
committeralokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-13 16:16:49 +0000
commit279365ed0047a2c3d98f38050e9067cf4488c8d5 (patch)
tree9833321a214f972248e9bb5647914df67f0f14ec /skia
parent4b2813ef0643601f6119a1ed7c9bf41d4679ac04 (diff)
downloadchromium_src-279365ed0047a2c3d98f38050e9067cf4488c8d5.zip
chromium_src-279365ed0047a2c3d98f38050e9067cf4488c8d5.tar.gz
chromium_src-279365ed0047a2c3d98f38050e9067cf4488c8d5.tar.bz2
Added skia::MakeOpaque helper function needed to rid WebKit of PlatformCanvas/Device dependency.
Review URL: http://codereview.chromium.org/6835025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81428 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia')
-rw-r--r--skia/ext/platform_canvas.cc5
-rw-r--r--skia/ext/platform_canvas.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/skia/ext/platform_canvas.cc b/skia/ext/platform_canvas.cc
index dfb40f7..5fff062 100644
--- a/skia/ext/platform_canvas.cc
+++ b/skia/ext/platform_canvas.cc
@@ -51,6 +51,11 @@ SkCanvas* CreateBitmapCanvas(int width, int height, bool is_opaque) {
return new PlatformCanvas(width, height, is_opaque);
}
+void MakeOpaque(const SkIRect& region, SkCanvas* canvas) {
+ GetTopPlatformDevice(canvas)->makeOpaque(region.fLeft, region.fTop,
+ region.width(), region.height());
+}
+
bool SupportsPlatformPaint(const SkCanvas* canvas) {
// TODO(alokp): Rename PlatformDevice::IsNativeFontRenderingAllowed after
// removing these calls from WebKit.
diff --git a/skia/ext/platform_canvas.h b/skia/ext/platform_canvas.h
index 24f613a..b8f28a9 100644
--- a/skia/ext/platform_canvas.h
+++ b/skia/ext/platform_canvas.h
@@ -119,6 +119,9 @@ class SK_API PlatformCanvas : public SkCanvas {
// transparency: this will enable some optimizations.
SK_API SkCanvas* CreateBitmapCanvas(int width, int height, bool is_opaque);
+// Sets the opacity of each pixel in the specified region to be opaque.
+SK_API void MakeOpaque(const SkIRect& region, SkCanvas* canvas);
+
// 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.