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

Unified Diff: content/renderer/webplugin_delegate_proxy.cc

Issue 10857023: linux/npapi: correctly clip damage rect when checking if the background has changed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 4 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: content/renderer/webplugin_delegate_proxy.cc
diff --git a/content/renderer/webplugin_delegate_proxy.cc b/content/renderer/webplugin_delegate_proxy.cc
index 55f2cd54e78558d609d1c56b0bfc5d5dac897dff..05a5410ae7084e9151d4a5955ad03bd12971f5dd 100644
--- a/content/renderer/webplugin_delegate_proxy.cc
+++ b/content/renderer/webplugin_delegate_proxy.cc
@@ -873,10 +873,11 @@ bool WebPluginDelegateProxy::BackgroundChanged(
DCHECK_EQ(cairo_image_surface_get_format(page_surface), CAIRO_FORMAT_ARGB32);
// Transform context coordinates into surface coordinates.
- double page_x_double = rect.x();
- double page_y_double = rect.y();
- cairo_user_to_device(context, &page_x_double, &page_y_double);
- gfx::Rect full_content_rect(0, 0,
+ double page_x_double = 0;
+ double page_y_double = 0;
+ cairo_device_to_user(context, &page_x_double, &page_y_double);
+ gfx::Rect full_content_rect(static_cast<int>(page_x_double),
+ static_cast<int>(page_y_double),
cairo_image_surface_get_width(page_surface),
cairo_image_surface_get_height(page_surface));
#endif
@@ -909,8 +910,8 @@ bool WebPluginDelegateProxy::BackgroundChanged(
cairo_surface_flush(page_surface);
const unsigned char* page_bytes = cairo_image_surface_get_data(page_surface);
int page_stride = cairo_image_surface_get_stride(page_surface);
- int page_start_x = static_cast<int>(page_x_double);
- int page_start_y = static_cast<int>(page_y_double);
+ int page_start_x = content_rect.x() - static_cast<int>(page_x_double);
+ int page_start_y = content_rect.y() - static_cast<int>(page_y_double);
skia::ScopedPlatformPaint scoped_platform_paint(
background_store_.canvas.get());
« 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