Commit 3d257761 authored by mazda@chromium.org's avatar mazda@chromium.org

Convert the sub-rectangle for GL functions from the views coordinate to the OpenGL coordinate.

BUG=118571


Review URL: https://chromiumcodereview.appspot.com/10826054

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148882 0039d316-1c4b-4281-b951-d872f2087c98
parent 90b769df
......@@ -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,
......
......@@ -832,10 +832,14 @@ 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_gl_subrect = src_gl_subrect.Scale(scale);
const bool result = compositing_iosurface_->CopyTo(
src_pixel_subrect,
src_pixel_gl_subrect,
dst_pixel_size,
output->getTopDevice()->accessBitmap(true).getPixels());
scoped_callback_runner.Release();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment