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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/renderer_host/render_widget_host_view_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 unsigned char* addr = static_cast<unsigned char*>( 503 unsigned char* addr = static_cast<unsigned char*>(
504 output->getTopDevice()->accessBitmap(true).getPixels()); 504 output->getTopDevice()->accessBitmap(true).getPixels());
505 scoped_callback_runner.Release(); 505 scoped_callback_runner.Release();
506 // Wrap the callback with an internal handler so that we can inject our 506 // Wrap the callback with an internal handler so that we can inject our
507 // own completion handlers (where we can call AdjustSurfaceProtection). 507 // own completion handlers (where we can call AdjustSurfaceProtection).
508 base::Callback<void(bool)> wrapper_callback = base::Bind( 508 base::Callback<void(bool)> wrapper_callback = base::Bind(
509 &RenderWidgetHostViewAura::CopyFromCompositingSurfaceFinished, 509 &RenderWidgetHostViewAura::CopyFromCompositingSurfaceFinished,
510 AsWeakPtr(), 510 AsWeakPtr(),
511 callback); 511 callback);
512 pending_thumbnail_tasks_.push_back(callback); 512 pending_thumbnail_tasks_.push_back(callback);
513 gfx::Rect src_subrect_in_pixel = ConvertRectToPixel(this, src_subrect); 513
514 // Convert |src_subrect| from the views coordinate (upper-left origin) into
515 // the OpenGL coordinate (lower-left origin).
516 gfx::Rect src_subrect_in_gl = src_subrect;
517 src_subrect_in_gl.set_y(GetViewBounds().height() - src_subrect.bottom());
518
519 gfx::Rect src_subrect_in_pixel = ConvertRectToPixel(this, src_subrect_in_gl);
514 gl_helper->CopyTextureTo(container->texture_id(), 520 gl_helper->CopyTextureTo(container->texture_id(),
515 container->size(), 521 container->size(),
516 src_subrect_in_pixel, 522 src_subrect_in_pixel,
517 dst_size_in_pixel, 523 dst_size_in_pixel,
518 addr, 524 addr,
519 wrapper_callback); 525 wrapper_callback);
520 } 526 }
521 527
522 void RenderWidgetHostViewAura::OnAcceleratedCompositingStateChange() { 528 void RenderWidgetHostViewAura::OnAcceleratedCompositingStateChange() {
523 // Delay processing the state change until we either get a software frame if 529 // Delay processing the state change until we either get a software frame if
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after
1642 RenderWidgetHost* widget) { 1648 RenderWidgetHost* widget) {
1643 return new RenderWidgetHostViewAura(widget); 1649 return new RenderWidgetHostViewAura(widget);
1644 } 1650 }
1645 1651
1646 // static 1652 // static
1647 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 1653 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
1648 GetScreenInfoForWindow(results, NULL); 1654 GetScreenInfoForWindow(results, NULL);
1649 } 1655 }
1650 1656
1651 } // namespace content 1657 } // namespace content
OLDNEW
« 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