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

Unified Diff: webkit/plugins/ppapi/ppb_graphics_2d_impl.cc

Issue 10069004: Fix per-tile painting support in Pepper Graphics2D plugins by using a temporary device independent … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use SkBitmap::copyTo. Created 8 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
diff --git a/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_2d_impl.cc
index f503862c6e123bc318c4b5fbc15df5f7aabc4e0f..89cba977ea524a0df0f064edeed3802ea76f2257 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698