| Index: android_webview/browser/hardware_renderer.cc
|
| diff --git a/android_webview/browser/hardware_renderer.cc b/android_webview/browser/hardware_renderer.cc
|
| index aab7f168ec11225241bb2bb0aa53096668a76bb1..6fa702a95cb0fa2ffc39249844b01d5c626de384 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_);
|
|
|
| @@ -110,7 +111,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())
|
| @@ -122,6 +124,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));
|
| }
|
| @@ -223,7 +226,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(
|
| @@ -246,15 +249,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,
|
| - uint32_t compositor_id) {
|
| - shared_renderer_state_->InsertReturnedResourcesOnRT(resources, compositor_id);
|
| + uint32_t compositor_id,
|
| + uint32_t output_surface_id) {
|
| + shared_renderer_state_->InsertReturnedResourcesOnRT(resources, compositor_id,
|
| + output_surface_id);
|
| }
|
|
|
| } // namespace android_webview
|
|
|