| Index: cc/output/gl_renderer.cc
|
| diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
|
| index 41beed50b901677769da4b4ec2d9a1f2e7f1b646..1e16121577db2a9cc48abc62b7b80c926382889e 100644
|
| --- a/cc/output/gl_renderer.cc
|
| +++ b/cc/output/gl_renderer.cc
|
| @@ -258,6 +258,8 @@ GLRenderer::~GLRenderer() {
|
| pending_async_read_pixels_.pop_back();
|
| }
|
|
|
| + in_use_overlay_resources_.clear();
|
| +
|
| CleanupSharedObjects();
|
| }
|
|
|
| @@ -2005,6 +2007,8 @@ void GLRenderer::FinishDrawingFrame(DrawingFrame* frame) {
|
|
|
| GLC(gl_, gl_->Disable(GL_BLEND));
|
| blend_shadow_ = false;
|
| +
|
| + ScheduleOverlays(frame);
|
| }
|
|
|
| void GLRenderer::FinishDrawingQuadList() { FlushTextureQuadCache(); }
|
| @@ -2176,6 +2180,11 @@ void GLRenderer::SwapBuffers(const CompositorFrameMetadata& metadata) {
|
| }
|
| output_surface_->SwapBuffers(&compositor_frame);
|
|
|
| + // Release previously used overlay resources and hold onto the pending ones
|
| + // until the next swap buffers.
|
| + in_use_overlay_resources_.clear();
|
| + in_use_overlay_resources_.swap(pending_overlay_resources_);
|
| +
|
| swap_buffer_rect_ = gfx::Rect();
|
|
|
| // We don't have real fences, so we mark read fences as passed
|
| @@ -3050,4 +3059,30 @@ bool GLRenderer::IsContextLost() {
|
| return output_surface_->context_provider()->IsContextLost();
|
| }
|
|
|
| +void GLRenderer::ScheduleOverlays(DrawingFrame* frame) {
|
| + if (!frame->overlay_list.size())
|
| + return;
|
| +
|
| + ResourceProvider::ResourceIdArray resources;
|
| + OverlayCandidateList& overlays = frame->overlay_list;
|
| + OverlayCandidateList::iterator it;
|
| + for (it = overlays.begin(); it != overlays.end(); ++it) {
|
| + const OverlayCandidate& overlay = *it;
|
| + // Skip primary plane.
|
| + if (overlay.plane_z_order == 0)
|
| + continue;
|
| +
|
| + pending_overlay_resources_.push_back(
|
| + make_scoped_ptr(new ResourceProvider::ScopedReadLockGL(
|
| + resource_provider(), overlay.resource_id)));
|
| +
|
| + context_support_->ScheduleOverlayPlane(
|
| + overlay.plane_z_order,
|
| + overlay.transform,
|
| + pending_overlay_resources_.back()->texture_id(),
|
| + overlay.display_rect,
|
| + overlay.uv_rect);
|
| + }
|
| +}
|
| +
|
| } // namespace cc
|
|
|