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

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

Issue 7215030: Don't copy the Graphics2D when binding a new one. This brings the (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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 | « ppapi/examples/2d/paint_manager_example.cc ('k') | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/ppapi_plugin_instance.cc
===================================================================
--- webkit/plugins/ppapi/ppapi_plugin_instance.cc (revision 89742)
+++ webkit/plugins/ppapi/ppapi_plugin_instance.cc (working copy)
@@ -1385,29 +1385,6 @@
if (!graphics_2d->BindToInstance(this))
return PP_FALSE; // Can't bind to more than one instance.
- // See http://crbug.com/49403: this can be further optimized by keeping the
- // old device around and painting from it.
- if (bound_graphics_2d()) {
- // Start the new image with the content of the old image until the plugin
- // repaints.
- // Use ImageDataAutoMapper to ensure the image data is valid.
- ImageDataAutoMapper mapper(bound_graphics_2d()->image_data());
- if (!mapper.is_valid())
- return PP_FALSE;
- const SkBitmap* old_backing_bitmap =
- bound_graphics_2d()->image_data()->GetMappedBitmap();
- SkRect old_size = SkRect::MakeWH(
- SkScalar(static_cast<float>(old_backing_bitmap->width())),
- SkScalar(static_cast<float>(old_backing_bitmap->height())));
-
- SkCanvas canvas(*graphics_2d->image_data()->GetMappedBitmap());
- canvas.drawBitmap(*old_backing_bitmap, 0, 0);
-
- // Fill in any extra space with white.
- canvas.clipRect(old_size, SkRegion::kDifference_Op);
- canvas.drawARGB(255, 255, 255, 255);
- }
-
bound_graphics_ = graphics_2d;
setBackingTextureId(0);
// BindToInstance will have invalidated the plugin if necessary.
« no previous file with comments | « ppapi/examples/2d/paint_manager_example.cc ('k') | webkit/plugins/ppapi/ppb_graphics_2d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698