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 5e89bbeda7ebed65b7fb2dde7c04b8d84c2f968a..a6f834b5c0b6ce03ba715590722ef8ce7f4f80d6 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -1742,6 +1742,14 @@ void LayerTreeHostImpl::SetTopControlsLayoutHeight(float height) { |
| SetFullRootLayerDamage(); |
| } |
| +void LayerTreeHostImpl::SynchronouslyInitializeAllTiles() { |
| + // Only valid for the single-threaded non-scheduled/synchronous case |
| + // using the zero copy raster worker pool. |
| + DCHECK(!proxy_->HasImplThread()); |
| + DCHECK(!settings_.single_thread_proxy_scheduler); |
|
reveman
2014/10/28 03:46:33
nit: can we DCHECK to make sure that settings.sche
enne (OOO)
2014/10/28 16:49:56
We only need the zero copy DCHECK if I follow your
reveman
2014/10/28 18:08:24
hm, this will only initialize some tiles if settin
|
| + single_thread_synchronous_task_graph_runner_->RunUntilIdle(); |
| +} |
| + |
| void LayerTreeHostImpl::DidLoseOutputSurface() { |
| if (resource_provider_) |
| resource_provider_->DidLoseOutputSurface(); |
| @@ -2019,7 +2027,7 @@ void LayerTreeHostImpl::CreateAndSetTileManager() { |
| resource_provider_->best_texture_format()); |
| raster_worker_pool_ = |
| - BitmapRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(), |
| + BitmapRasterWorkerPool::Create(task_runner, |
| RasterWorkerPool::GetTaskGraphRunner(), |
| resource_provider_.get()); |
| } else if (use_gpu_rasterization_) { |
| @@ -2039,10 +2047,20 @@ void LayerTreeHostImpl::CreateAndSetTileManager() { |
| GetMapImageTextureTarget(context_provider->ContextCapabilities()), |
| resource_provider_->best_texture_format()); |
| - raster_worker_pool_ = |
| - ZeroCopyRasterWorkerPool::Create(proxy_->ImplThreadTaskRunner(), |
| - RasterWorkerPool::GetTaskGraphRunner(), |
| - resource_provider_.get()); |
| + bool synchronous_single_threaded = |
| + !proxy_->HasImplThread() && !settings_.single_thread_proxy_scheduler; |
| + |
| + TaskGraphRunner* task_graph_runner; |
| + if (synchronous_single_threaded) { |
| + DCHECK(!single_thread_synchronous_task_graph_runner_); |
| + single_thread_synchronous_task_graph_runner_.reset(new TaskGraphRunner); |
| + task_graph_runner = single_thread_synchronous_task_graph_runner_.get(); |
| + } else { |
| + task_graph_runner = RasterWorkerPool::GetTaskGraphRunner(); |
| + } |
|
reveman
2014/10/28 03:46:33
I think you can replace all this with:
synchronou
|
| + |
| + raster_worker_pool_ = ZeroCopyRasterWorkerPool::Create( |
| + task_runner, task_graph_runner, resource_provider_.get()); |
| } else if (UseOneCopyRasterizer()) { |
| // We need to create a staging resource pool when using copy rasterizer. |
| staging_resource_pool_ = ResourcePool::Create( |
| @@ -2091,6 +2109,7 @@ void LayerTreeHostImpl::DestroyTileManager() { |
| resource_pool_ = nullptr; |
| staging_resource_pool_ = nullptr; |
| raster_worker_pool_ = nullptr; |
| + single_thread_synchronous_task_graph_runner_ = nullptr; |
| } |
| bool LayerTreeHostImpl::UsePendingTreeForSync() const { |