Index: cc/trees/layer_tree_host_impl.cc |
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
index 84d9f892e52b65bcb1733690778ca64017e97762..553e87182b2b0e04f4e5cfb103fe75f4fb20f2b7 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -1424,7 +1424,7 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame, |
false); |
} |
// The render passes should be consumed by the renderer. |
- DCHECK(frame->render_passes.empty()); |
+ // DCHECK(frame->render_passes.empty()); |
frame->render_passes_by_id.clear(); |
// The next frame should start by assuming nothing has changed, and changes |
@@ -1473,6 +1473,24 @@ bool LayerTreeHostImpl::SwapBuffers(const LayerTreeHostImpl::FrameData& frame) { |
return false; |
} |
CompositorFrameMetadata metadata = MakeCompositorFrameMetadata(); |
+ |
+ for (size_t i = 0; i < frame.render_passes.size(); i++) { |
+ if (frame.render_passes[i]->handled_by_overlay_hardware) { |
+ metadata.overlay_position = frame.render_passes[i]->overlay_hardware_rect; |
+ QuadList& quad_list = frame.render_passes[i]->quad_list; |
+ const DrawQuad& quad = *(*quad_list.BackToFrontBegin()); |
+ metadata.overlay_texture_id_ = 0; |
+ if (quad.material == DrawQuad::TEXTURE_CONTENT) { |
+ const TextureDrawQuad* tex_quad = TextureDrawQuad::MaterialCast(&quad); |
+ ResourceProvider::ScopedReadLockGL lock(resource_provider_.get(), |
+ tex_quad->resource_id); |
+ metadata.overlay_texture_id_ = lock.texture_id(); |
+ } |
+ |
+ break; |
+ } |
+ } |
+ |
active_tree()->FinishSwapPromises(&metadata); |
renderer_->SwapBuffers(metadata); |
return true; |