Chromium Code Reviews| 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 a7586d02309356c1eaf2ff01b681258a8eccc742..d31c9df73e95d5733b33c6612b6e9af201e8fb9e 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_android.cc |
| +++ b/content/browser/renderer_host/render_widget_host_view_android.cc |
| @@ -903,11 +903,12 @@ void RenderWidgetHostViewAndroid::CopyFromCompositingSurface( |
| content_view_core_->GetWindowAndroid()->GetCompositor(); |
| DCHECK(compositor); |
| DCHECK(!surface_id_.is_null()); |
| + compositor->AttachLayerForReadback(layer_); |
|
no sievers
2016/03/16 00:16:12
Hmm that looks dangerous to attach the layer (pote
Jinsuk Kim
2016/03/16 06:03:12
Changed to the comment in the bug.
|
| scoped_ptr<cc::CopyOutputRequest> request = |
| cc::CopyOutputRequest::CreateRequest( |
| base::Bind(&PrepareTextureCopyOutputResult, |
| dst_size_in_pixel, preferred_color_type, start_time, |
| - callback)); |
| + layer_, callback)); |
| if (!src_subrect_in_pixel.IsEmpty()) |
| request->set_area(src_subrect_in_pixel); |
| layer_->RequestCopyOfOutput(std::move(request)); |
| @@ -1927,6 +1928,7 @@ void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult( |
| const gfx::Size& dst_size_in_pixel, |
| SkColorType color_type, |
| const base::TimeTicks& start_time, |
| + scoped_refptr<cc::Layer> layer, |
| const ReadbackRequestCallback& callback, |
| scoped_ptr<cc::CopyOutputResult> result) { |
| base::ScopedClosureRunner scoped_callback_runner( |
| @@ -1934,6 +1936,7 @@ void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult( |
| TRACE_EVENT0("cc", |
| "RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult"); |
| + layer->RemoveFromParent(); |
| if (!result->HasTexture() || result->IsEmpty() || result->size().IsEmpty()) |
| return; |