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

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: fixed a bug 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..e2f298e6784117290b7a0e95287f5e980bda8237 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -891,8 +891,6 @@ void RenderWidgetHostViewAndroid::CopyFromCompositingSurface(
return;
}
- scoped_ptr<cc::CopyOutputRequest> request;
- scoped_refptr<cc::Layer> readback_layer;
if (!content_view_core_ || !(content_view_core_->GetWindowAndroid())) {
callback.Run(SkBitmap(), READBACK_FAILED);
return;
@@ -901,20 +899,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,
- dst_size_in_pixel, preferred_color_type, start_time,
- readback_layer, callback));
+ scoped_ptr<cc::CopyOutputRequest> request =
+ cc::CopyOutputRequest::CreateRequest(
+ base::Bind(&PrepareTextureCopyOutputResult,
+ dst_size_in_pixel, preferred_color_type, start_time,
+ callback));
if (!src_subrect_in_pixel.IsEmpty())
request->set_area(src_subrect_in_pixel);
- readback_layer->RequestCopyOfOutput(std::move(request));
+ layer_->RequestCopyOfOutput(std::move(request));
}
void RenderWidgetHostViewAndroid::CopyFromCompositingSurfaceToVideoFrame(
@@ -1930,20 +1922,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