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

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

Issue 1732323002: Remove layer for readback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
Index: content/browser/renderer_host/render_widget_host_view_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index ddb0f0ce1fb840d1ed944fc0e7a18a68f6385e85..90fa103df20265f38a9255066e07f1844903e057 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -901,20 +901,14 @@ void RenderWidgetHostViewAndroid::CopyFromCompositingSurface(
content_view_core_->GetWindowAndroid()->GetCompositor();
DCHECK(compositor);
DCHECK(!surface_id_.is_null());
- scoped_refptr<cc::Layer> layer = CreateDelegatedLayer();
- DCHECK(layer);
- layer->SetHideLayerAndSubtree(true);
- compositor->AttachLayerForReadback(layer);
-
- readback_layer = layer;
request = cc::CopyOutputRequest::CreateRequest(
base::Bind(&RenderWidgetHostViewAndroid::
- PrepareTextureCopyOutputResultForDelegatedReadback,
+ PrepareTextureCopyOutputResult,
dst_size_in_pixel, preferred_color_type, start_time,
- readback_layer, callback));
+ callback));
if (!src_subrect_in_pixel.IsEmpty())
request->set_area(src_subrect_in_pixel);
- readback_layer->RequestCopyOfOutput(std::move(request));
+ compositor->RequestCopyOfOutputOnRootLayer(std::move(request));
no sievers 2016/02/25 23:26:11 You want to use |layer_| here or you'll get the wh
Jinsuk Kim 2016/02/26 00:53:30 Thanks for helping out. Fixed.
}
void RenderWidgetHostViewAndroid::CopyFromCompositingSurfaceToVideoFrame(
@@ -1930,20 +1924,6 @@ void RenderWidgetHostViewAndroid::OnLostResources() {
DCHECK(ack_callbacks_.empty());
}
-// static
-void RenderWidgetHostViewAndroid::
- PrepareTextureCopyOutputResultForDelegatedReadback(
- const gfx::Size& dst_size_in_pixel,
- SkColorType color_type,
- const base::TimeTicks& start_time,
- scoped_refptr<cc::Layer> readback_layer,
- const ReadbackRequestCallback& callback,
- scoped_ptr<cc::CopyOutputResult> result) {
- readback_layer->RemoveFromParent();
- PrepareTextureCopyOutputResult(dst_size_in_pixel, color_type, start_time,
- callback, std::move(result));
-}
-
// TODO(wjmaclean): There is significant overlap between
// PrepareTextureCopyOutputResult and CopyFromCompositingSurfaceFinished in
// this file, and the versions in surface_utils.cc. They should
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.h ('k') | ui/android/window_android_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698