OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 2020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2031 | 2031 |
2032 void LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool( | 2032 void LayerTreeHostImpl::CreateResourceAndTileTaskWorkerPool( |
2033 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, | 2033 scoped_ptr<TileTaskWorkerPool>* tile_task_worker_pool, |
2034 scoped_ptr<ResourcePool>* resource_pool, | 2034 scoped_ptr<ResourcePool>* resource_pool, |
2035 scoped_ptr<ResourcePool>* staging_resource_pool) { | 2035 scoped_ptr<ResourcePool>* staging_resource_pool) { |
2036 base::SingleThreadTaskRunner* task_runner = | 2036 base::SingleThreadTaskRunner* task_runner = |
2037 proxy_->HasImplThread() ? proxy_->ImplThreadTaskRunner() | 2037 proxy_->HasImplThread() ? proxy_->ImplThreadTaskRunner() |
2038 : proxy_->MainThreadTaskRunner(); | 2038 : proxy_->MainThreadTaskRunner(); |
2039 DCHECK(task_runner); | 2039 DCHECK(task_runner); |
2040 | 2040 |
2041 // Pass the single-threaded synchronous task graph runner to the worker pool | |
2042 // if we're in synchronous single-threaded mode. | |
2043 TaskGraphRunner* task_graph_runner = task_graph_runner_; | |
2044 if (IsSynchronousSingleThreaded()) { | |
2045 DCHECK(!single_thread_synchronous_task_graph_runner_); | |
2046 single_thread_synchronous_task_graph_runner_.reset(new TaskGraphRunner); | |
2047 task_graph_runner = single_thread_synchronous_task_graph_runner_.get(); | |
2048 } | |
2049 | |
2041 ContextProvider* context_provider = output_surface_->context_provider(); | 2050 ContextProvider* context_provider = output_surface_->context_provider(); |
2042 if (!context_provider) { | 2051 if (!context_provider) { |
2043 *resource_pool = | 2052 *resource_pool = |
2044 ResourcePool::Create(resource_provider_.get(), GL_TEXTURE_2D); | 2053 ResourcePool::Create(resource_provider_.get(), GL_TEXTURE_2D); |
2045 | 2054 |
2046 *tile_task_worker_pool = BitmapTileTaskWorkerPool::Create( | 2055 *tile_task_worker_pool = BitmapTileTaskWorkerPool::Create( |
2047 task_runner, task_graph_runner_, resource_provider_.get()); | 2056 task_runner, task_graph_runner_, resource_provider_.get()); |
vmpstr
2015/05/14 20:00:19
Is this supposed to be using task_graph_runner (th
| |
2048 return; | 2057 return; |
2049 } | 2058 } |
2050 | 2059 |
2051 // Pass the single-threaded synchronous task graph runner to the worker pool | |
2052 // if we're in synchronous single-threaded mode. | |
2053 TaskGraphRunner* task_graph_runner = task_graph_runner_; | |
2054 if (IsSynchronousSingleThreaded()) { | |
2055 DCHECK(!single_thread_synchronous_task_graph_runner_); | |
2056 single_thread_synchronous_task_graph_runner_.reset(new TaskGraphRunner); | |
2057 task_graph_runner = single_thread_synchronous_task_graph_runner_.get(); | |
2058 } | |
2059 | |
2060 if (use_gpu_rasterization_) { | 2060 if (use_gpu_rasterization_) { |
2061 *resource_pool = | 2061 *resource_pool = |
2062 ResourcePool::Create(resource_provider_.get(), GL_TEXTURE_2D); | 2062 ResourcePool::Create(resource_provider_.get(), GL_TEXTURE_2D); |
2063 | 2063 |
2064 int msaa_sample_count = | 2064 int msaa_sample_count = |
2065 use_msaa_ ? settings_.gpu_rasterization_msaa_sample_count : 0; | 2065 use_msaa_ ? settings_.gpu_rasterization_msaa_sample_count : 0; |
2066 | 2066 |
2067 *tile_task_worker_pool = GpuTileTaskWorkerPool::Create( | 2067 *tile_task_worker_pool = GpuTileTaskWorkerPool::Create( |
2068 task_runner, task_graph_runner, context_provider, | 2068 task_runner, task_graph_runner, context_provider, |
2069 resource_provider_.get(), settings_.use_distance_field_text, | 2069 resource_provider_.get(), settings_.use_distance_field_text, |
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3399 new_target.SetToMin(layer_impl->MaxScrollOffset()); | 3399 new_target.SetToMin(layer_impl->MaxScrollOffset()); |
3400 | 3400 |
3401 curve->UpdateTarget( | 3401 curve->UpdateTarget( |
3402 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) | 3402 animation->TrimTimeToCurrentIteration(CurrentBeginFrameArgs().frame_time) |
3403 .InSecondsF(), | 3403 .InSecondsF(), |
3404 new_target); | 3404 new_target); |
3405 | 3405 |
3406 return true; | 3406 return true; |
3407 } | 3407 } |
3408 } // namespace cc | 3408 } // namespace cc |
OLD | NEW |