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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

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: address comment 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 | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | 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_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index e1d669688b62e4afe40b8548985fae400be20209..943a14e07405a7a9d44b66a07a6eddfc8c26e01e 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -510,7 +510,13 @@ void RenderWidgetHostViewAura::CopyFromCompositingSurface(
AsWeakPtr(),
callback);
pending_thumbnail_tasks_.push_back(callback);
- gfx::Rect src_subrect_in_pixel = ConvertRectToPixel(this, src_subrect);
+
+ // Convert |src_subrect| from the views coordinate (upper-left origin) into
+ // the OpenGL coordinate (lower-left origin).
+ gfx::Rect src_subrect_in_gl = src_subrect;
+ src_subrect_in_gl.set_y(GetViewBounds().height() - src_subrect.bottom());
+
+ gfx::Rect src_subrect_in_pixel = ConvertRectToPixel(this, src_subrect_in_gl);
gl_helper->CopyTextureTo(container->texture_id(),
container->size(),
src_subrect_in_pixel,
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698