Chromium Code Reviews| 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 8050377440ffb539d1b56570176a9c2e6dcad118..71e0c9d4cc442156c9538c2e7650e81eb61d6aee 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -64,11 +64,14 @@ |
| #include "cc/trees/occlusion_tracker.h" |
| #include "cc/trees/single_thread_proxy.h" |
| #include "cc/trees/tree_synchronizer.h" |
| +#include "gpu/command_buffer/client/gles2_interface.h" |
| #include "gpu/GLES2/gl2extchromium.h" |
| #include "ui/gfx/frame_time.h" |
| #include "ui/gfx/size_conversions.h" |
| #include "ui/gfx/vector2d_conversions.h" |
| +using gpu::gles2::GLES2Interface; |
| + |
| namespace { |
| void DidVisibilityChange(cc::LayerTreeHostImpl* id, bool visible) { |
| @@ -1374,8 +1377,11 @@ void LayerTreeHostImpl::ReclaimResources(const CompositorFrameAck* ack) { |
| // If we're not visible, we likely released resources, so we want to |
| // aggressively flush here to make sure those DeleteTextures make it to the |
| // GPU process to free up the memory. |
| - if (resource_provider_ && !visible_) |
| - resource_provider_->ShallowFlushIfSupported(); |
| + if (output_surface_ && !visible_) { |
|
danakj
2014/07/11 16:49:04
if os and os->context_provider() && !visible
|
| + GLES2Interface* gl = output_surface_->context_provider()->ContextGL(); |
| + if (gl) |
|
danakj
2014/07/11 16:49:04
don't need to check gl
|
| + gl->ShallowFlushCHROMIUM(); |
| + } |
| } |
| void LayerTreeHostImpl::OnCanDrawStateChangedForTree() { |
| @@ -1909,8 +1915,10 @@ void LayerTreeHostImpl::CreateAndSetTileManager() { |
| GL_TEXTURE_2D, |
| resource_provider_->best_texture_format()); |
| - raster_worker_pool_ = GpuRasterWorkerPool::Create( |
| - proxy_->ImplThreadTaskRunner(), resource_provider_.get()); |
| + raster_worker_pool_ = |
| + GpuRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(), |
| + context_provider, |
| + resource_provider_.get()); |
| on_demand_task_graph_runner_ = &synchronous_task_graph_runner_; |
| } else if (UseZeroCopyTextureUpload()) { |
| resource_pool_ = |
| @@ -1937,6 +1945,7 @@ void LayerTreeHostImpl::CreateAndSetTileManager() { |
| raster_worker_pool_ = ImageCopyRasterWorkerPool::Create( |
| proxy_->ImplThreadTaskRunner(), |
| RasterWorkerPool::GetTaskGraphRunner(), |
| + context_provider, |
| resource_provider_.get(), |
| staging_resource_pool_.get()); |
| on_demand_task_graph_runner_ = RasterWorkerPool::GetTaskGraphRunner(); |
| @@ -1949,6 +1958,7 @@ void LayerTreeHostImpl::CreateAndSetTileManager() { |
| raster_worker_pool_ = PixelBufferRasterWorkerPool::Create( |
| proxy_->ImplThreadTaskRunner(), |
| RasterWorkerPool::GetTaskGraphRunner(), |
| + context_provider, |
| resource_provider_.get(), |
| transfer_buffer_memory_limit_); |
| on_demand_task_graph_runner_ = RasterWorkerPool::GetTaskGraphRunner(); |