diff options
author | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-13 20:19:05 +0000 |
---|---|---|
committer | reveman@chromium.org <reveman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-13 20:19:05 +0000 |
commit | 38d0108dd611a2cb0b34eddcf295a233308821ba (patch) | |
tree | 138344bce42ebb64377b3bd4edd14562f69537cc /webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | |
parent | e6d0ab487b61db6a3bd1b89972011dec72301f13 (diff) | |
download | chromium_src-38d0108dd611a2cb0b34eddcf295a233308821ba.zip chromium_src-38d0108dd611a2cb0b34eddcf295a233308821ba.tar.gz chromium_src-38d0108dd611a2cb0b34eddcf295a233308821ba.tar.bz2 |
Fix per-tile painting support in Pepper Graphics2D plugins by using a temporary device independent bitmap when necessary.
BUG=122820
TEST=ppapi/example/example.html
Review URL: http://codereview.chromium.org/10069004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132256 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/ppapi/ppb_graphics_2d_impl.cc')
-rw-r--r-- | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc index f503862c..89cba97 100644 --- a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc +++ b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc @@ -548,13 +548,21 @@ void PPB_Graphics2D_Impl::Paint(WebKit::WebCanvas* canvas, canvas->restore(); } + SkBitmap image; + // Copy to device independent bitmap when target canvas doesn't support + // platform paint. + if (!skia::SupportsPlatformPaint(canvas)) + backing_bitmap.copyTo(&image, SkBitmap::kARGB_8888_Config); + else + image = backing_bitmap; + SkPaint paint; if (is_always_opaque_) { // When we know the device is opaque, we can disable blending for slightly // more optimized painting. paint.setXfermodeMode(SkXfermode::kSrc_Mode); } - canvas->drawBitmap(backing_bitmap, + canvas->drawBitmap(image, SkIntToScalar(plugin_rect.x()), SkIntToScalar(plugin_rect.y()), &paint); |