Chromium Code Reviews| Index: android_webview/browser/hardware_renderer.cc |
| diff --git a/android_webview/browser/hardware_renderer.cc b/android_webview/browser/hardware_renderer.cc |
| index 5688b1ca0580aa3a5553129eea75c72f64171580..1f146eca6661fb99255a033f3d15f2775e5b4130 100644 |
| --- a/android_webview/browser/hardware_renderer.cc |
| +++ b/android_webview/browser/hardware_renderer.cc |
| @@ -38,7 +38,8 @@ HardwareRenderer::HardwareRenderer(SharedRendererState* state) |
| : shared_renderer_state_(state), |
| last_egl_context_(eglGetCurrentContext()), |
| gl_surface_(new AwGLSurface), |
| - compositor_id_(0), // Valid compositor id starts at 1. |
| + compositor_id_(0u), // Valid compositor id starts at 1. |
| + output_surface_id_(0u), |
| output_surface_(NULL) { |
| DCHECK(last_egl_context_); |
| @@ -105,7 +106,8 @@ void HardwareRenderer::DrawGL(AwDrawGLInfo* draw_info, |
| // kModeProcess. Instead, submit the frame in "kModeDraw" stage to avoid |
| // unnecessary kModeProcess. |
| if (child_frame_.get() && child_frame_->frame.get()) { |
| - if (compositor_id_ != child_frame_->compositor_id) { |
| + if (compositor_id_ != child_frame_->compositor_id || |
| + output_surface_id_ != child_frame_->output_surface_id) { |
| if (!root_id_.is_null()) |
| surface_factory_->Destroy(root_id_); |
| if (!child_id_.is_null()) |
| @@ -117,6 +119,7 @@ void HardwareRenderer::DrawGL(AwDrawGLInfo* draw_info, |
| // This will return all the resources to the previous compositor. |
| surface_factory_.reset(); |
| compositor_id_ = child_frame_->compositor_id; |
| + output_surface_id_ = child_frame_->output_surface_id; |
| surface_factory_.reset( |
| new cc::SurfaceFactory(surface_manager_.get(), this)); |
| } |
| @@ -218,7 +221,7 @@ void HardwareRenderer::DrawGL(AwDrawGLInfo* draw_info, |
| void HardwareRenderer::ReturnResources( |
| const cc::ReturnedResourceArray& resources) { |
| - ReturnResourcesToCompositor(resources, compositor_id_); |
| + ReturnResourcesToCompositor(resources, compositor_id_, output_surface_id_); |
| } |
| void HardwareRenderer::SetBeginFrameSource( |
| @@ -242,15 +245,18 @@ void HardwareRenderer::ReturnResourcesInChildFrame() { |
| // The child frame's compositor id is not necessarily same as |
| // compositor_id_. |
| ReturnResourcesToCompositor(resources_to_return, |
| - child_frame_->compositor_id); |
| + child_frame_->compositor_id, |
| + child_frame_->output_surface_id); |
| } |
| child_frame_.reset(); |
| } |
| void HardwareRenderer::ReturnResourcesToCompositor( |
| const cc::ReturnedResourceArray& resources, |
| - unsigned int compositor_id) { |
| - shared_renderer_state_->InsertReturnedResourcesOnRT(resources, compositor_id); |
| + unsigned int compositor_id, |
| + uint32_t output_surface_id) { |
|
hush (inactive)
2016/03/08 23:55:49
A bit weird that we have both unsigned int and uin
boliu
2016/03/09 00:29:58
Compositor_id doesn't leave the browser process, s
|
| + shared_renderer_state_->InsertReturnedResourcesOnRT(resources, compositor_id, |
| + output_surface_id); |
| } |
| } // namespace android_webview |