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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 11234008: Enable texture readback support for Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 2 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
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 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 AsWeakPtr(), 668 AsWeakPtr(),
669 callback); 669 callback);
670 pending_thumbnail_tasks_.push_back(callback); 670 pending_thumbnail_tasks_.push_back(callback);
671 671
672 // Convert |src_subrect| from the views coordinate (upper-left origin) into 672 // Convert |src_subrect| from the views coordinate (upper-left origin) into
673 // the OpenGL coordinate (lower-left origin). 673 // the OpenGL coordinate (lower-left origin).
674 gfx::Rect src_subrect_in_gl = src_subrect; 674 gfx::Rect src_subrect_in_gl = src_subrect;
675 src_subrect_in_gl.set_y(GetViewBounds().height() - src_subrect.bottom()); 675 src_subrect_in_gl.set_y(GetViewBounds().height() - src_subrect.bottom());
676 676
677 gfx::Rect src_subrect_in_pixel = ConvertRectToPixel(this, src_subrect_in_gl); 677 gfx::Rect src_subrect_in_pixel = ConvertRectToPixel(this, src_subrect_in_gl);
678 gl_helper->CopyTextureTo(container->PrepareTexture(), 678 gl_helper->CropScaleReadbackAndCleanTexture(container->PrepareTexture(),
679 container->size(), 679 container->size(),
680 src_subrect_in_pixel, 680 src_subrect_in_pixel,
681 dst_size_in_pixel, 681 dst_size_in_pixel,
682 addr, 682 addr,
683 wrapper_callback); 683 wrapper_callback);
684 } 684 }
685 685
686 void RenderWidgetHostViewAura::OnAcceleratedCompositingStateChange() { 686 void RenderWidgetHostViewAura::OnAcceleratedCompositingStateChange() {
687 // Delay processing the state change until we either get a software frame if 687 // Delay processing the state change until we either get a software frame if
688 // switching to software mode or receive a buffers swapped notification 688 // switching to software mode or receive a buffers swapped notification
689 // if switching to accelerated mode. 689 // if switching to accelerated mode.
690 // Sometimes (e.g. on a page load) the renderer will spuriously disable then 690 // Sometimes (e.g. on a page load) the renderer will spuriously disable then
691 // re-enable accelerated compositing, causing us to flash. 691 // re-enable accelerated compositing, causing us to flash.
692 // TODO(piman): factor the enable/disable accelerated compositing message into 692 // TODO(piman): factor the enable/disable accelerated compositing message into
693 // the UpdateRect/AcceleratedSurfaceBuffersSwapped messages so that we have 693 // the UpdateRect/AcceleratedSurfaceBuffersSwapped messages so that we have
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1878 RenderWidgetHost* widget) { 1878 RenderWidgetHost* widget) {
1879 return new RenderWidgetHostViewAura(widget); 1879 return new RenderWidgetHostViewAura(widget);
1880 } 1880 }
1881 1881
1882 // static 1882 // static
1883 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) { 1883 void RenderWidgetHostViewPort::GetDefaultScreenInfo(WebScreenInfo* results) {
1884 GetScreenInfoForWindow(results, NULL); 1884 GetScreenInfoForWindow(results, NULL);
1885 } 1885 }
1886 1886
1887 } // namespace content 1887 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | content/common/gpu/client/gl_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698