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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "cc/output/software_renderer.h" | 51 #include "cc/output/software_renderer.h" |
52 #include "cc/output/texture_mailbox_deleter.h" | 52 #include "cc/output/texture_mailbox_deleter.h" |
53 #include "cc/quads/render_pass_draw_quad.h" | 53 #include "cc/quads/render_pass_draw_quad.h" |
54 #include "cc/quads/shared_quad_state.h" | 54 #include "cc/quads/shared_quad_state.h" |
55 #include "cc/quads/solid_color_draw_quad.h" | 55 #include "cc/quads/solid_color_draw_quad.h" |
56 #include "cc/quads/texture_draw_quad.h" | 56 #include "cc/quads/texture_draw_quad.h" |
57 #include "cc/raster/bitmap_tile_task_worker_pool.h" | 57 #include "cc/raster/bitmap_tile_task_worker_pool.h" |
58 #include "cc/raster/gpu_rasterizer.h" | 58 #include "cc/raster/gpu_rasterizer.h" |
59 #include "cc/raster/gpu_tile_task_worker_pool.h" | 59 #include "cc/raster/gpu_tile_task_worker_pool.h" |
60 #include "cc/raster/one_copy_tile_task_worker_pool.h" | 60 #include "cc/raster/one_copy_tile_task_worker_pool.h" |
| 61 #include "cc/raster/synchronous_task_graph_runner.h" |
61 #include "cc/raster/tile_task_worker_pool.h" | 62 #include "cc/raster/tile_task_worker_pool.h" |
62 #include "cc/raster/zero_copy_tile_task_worker_pool.h" | 63 #include "cc/raster/zero_copy_tile_task_worker_pool.h" |
63 #include "cc/resources/memory_history.h" | 64 #include "cc/resources/memory_history.h" |
64 #include "cc/resources/resource_pool.h" | 65 #include "cc/resources/resource_pool.h" |
65 #include "cc/resources/ui_resource_bitmap.h" | 66 #include "cc/resources/ui_resource_bitmap.h" |
66 #include "cc/scheduler/delay_based_time_source.h" | 67 #include "cc/scheduler/delay_based_time_source.h" |
67 #include "cc/tiles/eviction_tile_priority_queue.h" | 68 #include "cc/tiles/eviction_tile_priority_queue.h" |
68 #include "cc/tiles/picture_layer_tiling.h" | 69 #include "cc/tiles/picture_layer_tiling.h" |
69 #include "cc/tiles/raster_tile_priority_queue.h" | 70 #include "cc/tiles/raster_tile_priority_queue.h" |
70 #include "cc/trees/damage_tracker.h" | 71 #include "cc/trees/damage_tracker.h" |
(...skipping 2065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2136 DCHECK(GetTaskRunner()); | 2137 DCHECK(GetTaskRunner()); |
2137 // TODO(vmpstr): Make this a DCHECK (or remove) when crbug.com/419086 is | 2138 // TODO(vmpstr): Make this a DCHECK (or remove) when crbug.com/419086 is |
2138 // resolved. | 2139 // resolved. |
2139 CHECK(resource_provider_); | 2140 CHECK(resource_provider_); |
2140 | 2141 |
2141 // Pass the single-threaded synchronous task graph runner to the worker pool | 2142 // Pass the single-threaded synchronous task graph runner to the worker pool |
2142 // if we're in synchronous single-threaded mode. | 2143 // if we're in synchronous single-threaded mode. |
2143 TaskGraphRunner* task_graph_runner = task_graph_runner_; | 2144 TaskGraphRunner* task_graph_runner = task_graph_runner_; |
2144 if (is_synchronous_single_threaded_) { | 2145 if (is_synchronous_single_threaded_) { |
2145 DCHECK(!single_thread_synchronous_task_graph_runner_); | 2146 DCHECK(!single_thread_synchronous_task_graph_runner_); |
2146 single_thread_synchronous_task_graph_runner_.reset(new TaskGraphRunner); | 2147 single_thread_synchronous_task_graph_runner_.reset( |
| 2148 new SynchronousTaskGraphRunner); |
2147 task_graph_runner = single_thread_synchronous_task_graph_runner_.get(); | 2149 task_graph_runner = single_thread_synchronous_task_graph_runner_.get(); |
2148 } | 2150 } |
2149 | 2151 |
2150 ContextProvider* context_provider = output_surface_->context_provider(); | 2152 ContextProvider* context_provider = output_surface_->context_provider(); |
2151 if (!context_provider) { | 2153 if (!context_provider) { |
2152 *resource_pool = | 2154 *resource_pool = |
2153 ResourcePool::Create(resource_provider_.get(), GetTaskRunner()); | 2155 ResourcePool::Create(resource_provider_.get(), GetTaskRunner()); |
2154 | 2156 |
2155 *tile_task_worker_pool = BitmapTileTaskWorkerPool::Create( | 2157 *tile_task_worker_pool = BitmapTileTaskWorkerPool::Create( |
2156 GetTaskRunner(), task_graph_runner, resource_provider_.get()); | 2158 GetTaskRunner(), task_graph_runner, resource_provider_.get()); |
(...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3696 return task_runner_provider_->HasImplThread(); | 3698 return task_runner_provider_->HasImplThread(); |
3697 } | 3699 } |
3698 | 3700 |
3699 bool LayerTreeHostImpl::CommitToActiveTree() const { | 3701 bool LayerTreeHostImpl::CommitToActiveTree() const { |
3700 // In single threaded mode we skip the pending tree and commit directly to the | 3702 // In single threaded mode we skip the pending tree and commit directly to the |
3701 // active tree. | 3703 // active tree. |
3702 return !task_runner_provider_->HasImplThread(); | 3704 return !task_runner_provider_->HasImplThread(); |
3703 } | 3705 } |
3704 | 3706 |
3705 } // namespace cc | 3707 } // namespace cc |
OLD | NEW |