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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 10826054: Convert the sub-rectangle for GL functions from the views coordinate to the OpenGL coordinate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index cb3ecf5cb2e6e14f873954cf6c5ea4f0da88b82e..e5147bbe632a9184c12c72dacd219f49d21eed8e 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -832,8 +832,12 @@ void RenderWidgetHostViewMac::CopyFromCompositingSurface(
dst_pixel_size.width(), dst_pixel_size.height(), true))
return;
- gfx::Rect src_pixel_subrect(src_subrect.origin().Scale(scale),
- src_subrect.size().Scale(scale));
+ // Convert |src_subrect| from the views coordinate (upper-left origin) into
+ // the OpenGL coordinate (lower-left origin).
+ gfx::Rect src_gl_subrect = src_subrect;
+ src_gl_subrect.set_y(GetViewBounds().height() - src_subrect.bottom());
+
+ gfx::Rect src_pixel_subrect = src_gl_subrect.Scale(scale);
Nico 2012/07/28 01:40:19 nit: src_pixel_gl_subrect
mazda 2012/07/28 01:49:08 Done.
const bool result = compositing_iosurface_->CopyTo(
src_pixel_subrect,
dst_pixel_size,
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698