Chromium Code Reviews| Index: cc/output/gl_renderer.cc |
| diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc |
| index d3d4851682aee72852ed50da25067c24651b6f58..c1c5f70a0aa43d233a5c3e7a8931767b64971154 100644 |
| --- a/cc/output/gl_renderer.cc |
| +++ b/cc/output/gl_renderer.cc |
| @@ -2660,21 +2660,26 @@ void GLRenderer::SwapBuffersComplete() { |
| gl_->ScheduleCALayerInUseQueryCHROMIUM(textures.size(), textures.data()); |
| } |
| } else if (swapping_overlay_resources_.size() > 1) { |
| + resource_provider_->SetBatchReturnResources(true); |
|
Daniele Castagna
2017/03/24 01:44:43
Should we have something like ScopedBacthReturnRes
|
| + |
| // If a query is not needed to release the overlay buffers, we can assume |
| // that once a swap buffer has completed we can remove the oldest buffers |
| // from the queue. |
| swapping_overlay_resources_.pop_front(); |
| + resource_provider_->SetBatchReturnResources(false); |
| } |
| } |
| void GLRenderer::DidReceiveTextureInUseResponses( |
| const gpu::TextureInUseResponses& responses) { |
| DCHECK(settings_->release_overlay_resources_after_gpu_query); |
| + resource_provider_->SetBatchReturnResources(true); |
| for (const gpu::TextureInUseResponse& response : responses) { |
| if (!response.in_use) { |
| swapped_and_acked_overlay_resources_.erase(response.texture); |
| } |
| } |
| + resource_provider_->SetBatchReturnResources(false); |
| color_lut_cache_.Swap(); |
| } |
| @@ -3214,13 +3219,15 @@ void GLRenderer::ScheduleDCLayers() { |
| current_frame()->dc_layer_overlay_list) { |
| DCHECK(!dc_layer_overlay.rpdq); |
| - ResourceId contents_resource_id = dc_layer_overlay.contents_resource_id; |
| unsigned texture_id = 0; |
| - if (contents_resource_id) { |
| - pending_overlay_resources_.push_back( |
| - base::MakeUnique<ResourceProvider::ScopedReadLockGL>( |
| - resource_provider_, contents_resource_id)); |
| - texture_id = pending_overlay_resources_.back()->texture_id(); |
| + for (const auto& contents_resource_id : dc_layer_overlay.resources) { |
| + if (contents_resource_id) { |
| + pending_overlay_resources_.push_back( |
| + base::MakeUnique<ResourceProvider::ScopedReadLockGL>( |
| + resource_provider_, contents_resource_id)); |
| + if (!texture_id) |
| + texture_id = pending_overlay_resources_.back()->texture_id(); |
| + } |
| } |
| GLfloat contents_rect[4] = { |
| dc_layer_overlay.contents_rect.x(), dc_layer_overlay.contents_rect.y(), |