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

Unified Diff: chrome/renderer/webplugin_delegate_proxy.cc

Issue 372078: Fix partial updates of transparent plugin backgrounds on Mac (Closed)
Patch Set: Created 11 years, 1 month 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 | « chrome/plugin/webplugin_proxy.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/webplugin_delegate_proxy.cc
diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc
index fe3bec18c687db069208ee4c0bad204fc284e5d8..aa945c79fc2a51a362f4e851b87289afb5cc1929 100644
--- a/chrome/renderer/webplugin_delegate_proxy.cc
+++ b/chrome/renderer/webplugin_delegate_proxy.cc
@@ -555,11 +555,17 @@ void WebPluginDelegateProxy::Paint(WebKit::WebCanvas* canvas,
gfx::Rect offset_rect = rect;
offset_rect.Offset(-plugin_rect_.x(), -plugin_rect_.y());
+ gfx::Rect canvas_rect = offset_rect;
+#if defined(OS_MACOSX)
+ // The canvases are flipped relative to the context, so flip the rect too.
+ FlipRectVerticallyWithHeight(&canvas_rect, plugin_rect_.height());
+#endif
bool background_changed = false;
if (background_store_canvas_.get() && BackgroundChanged(context, rect)) {
background_changed = true;
- BlitContextToCanvas(background_store_canvas_.get(), offset_rect,
+ gfx::Rect flipped_offset_rect = offset_rect;
+ BlitContextToCanvas(background_store_canvas_.get(), canvas_rect,
context, rect.origin());
}
@@ -568,11 +574,8 @@ void WebPluginDelegateProxy::Paint(WebKit::WebCanvas* canvas,
CopyFromTransportToBacking(offset_rect);
}
-#if defined(OS_MACOSX)
- FlipRectVerticallyWithHeight(&offset_rect, plugin_rect_.height());
-#endif
BlitCanvasToContext(context, rect, backing_store_canvas_.get(),
- offset_rect.origin());
+ canvas_rect.origin());
if (invalidate_pending_) {
// Only send the PaintAck message if this paint is in response to an
« no previous file with comments | « chrome/plugin/webplugin_proxy.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698