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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #include "cc/output/software_renderer.h" | 52 #include "cc/output/software_renderer.h" |
53 #include "cc/output/texture_mailbox_deleter.h" | 53 #include "cc/output/texture_mailbox_deleter.h" |
54 #include "cc/quads/render_pass_draw_quad.h" | 54 #include "cc/quads/render_pass_draw_quad.h" |
55 #include "cc/quads/shared_quad_state.h" | 55 #include "cc/quads/shared_quad_state.h" |
56 #include "cc/quads/solid_color_draw_quad.h" | 56 #include "cc/quads/solid_color_draw_quad.h" |
57 #include "cc/quads/texture_draw_quad.h" | 57 #include "cc/quads/texture_draw_quad.h" |
58 #include "cc/raster/bitmap_tile_task_worker_pool.h" | 58 #include "cc/raster/bitmap_tile_task_worker_pool.h" |
59 #include "cc/raster/gpu_rasterizer.h" | 59 #include "cc/raster/gpu_rasterizer.h" |
60 #include "cc/raster/gpu_tile_task_worker_pool.h" | 60 #include "cc/raster/gpu_tile_task_worker_pool.h" |
61 #include "cc/raster/one_copy_tile_task_worker_pool.h" | 61 #include "cc/raster/one_copy_tile_task_worker_pool.h" |
| 62 #include "cc/raster/synchronous_task_graph_runner.h" |
62 #include "cc/raster/tile_task_worker_pool.h" | 63 #include "cc/raster/tile_task_worker_pool.h" |
63 #include "cc/raster/zero_copy_tile_task_worker_pool.h" | 64 #include "cc/raster/zero_copy_tile_task_worker_pool.h" |
64 #include "cc/resources/memory_history.h" | 65 #include "cc/resources/memory_history.h" |
65 #include "cc/resources/resource_pool.h" | 66 #include "cc/resources/resource_pool.h" |
66 #include "cc/resources/ui_resource_bitmap.h" | 67 #include "cc/resources/ui_resource_bitmap.h" |
67 #include "cc/scheduler/delay_based_time_source.h" | 68 #include "cc/scheduler/delay_based_time_source.h" |
68 #include "cc/tiles/eviction_tile_priority_queue.h" | 69 #include "cc/tiles/eviction_tile_priority_queue.h" |
69 #include "cc/tiles/picture_layer_tiling.h" | 70 #include "cc/tiles/picture_layer_tiling.h" |
70 #include "cc/tiles/raster_tile_priority_queue.h" | 71 #include "cc/tiles/raster_tile_priority_queue.h" |
71 #include "cc/trees/damage_tracker.h" | 72 #include "cc/trees/damage_tracker.h" |
(...skipping 2072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2144 DCHECK(GetTaskRunner()); | 2145 DCHECK(GetTaskRunner()); |
2145 // TODO(vmpstr): Make this a DCHECK (or remove) when crbug.com/419086 is | 2146 // TODO(vmpstr): Make this a DCHECK (or remove) when crbug.com/419086 is |
2146 // resolved. | 2147 // resolved. |
2147 CHECK(resource_provider_); | 2148 CHECK(resource_provider_); |
2148 | 2149 |
2149 // Pass the single-threaded synchronous task graph runner to the worker pool | 2150 // Pass the single-threaded synchronous task graph runner to the worker pool |
2150 // if we're in synchronous single-threaded mode. | 2151 // if we're in synchronous single-threaded mode. |
2151 TaskGraphRunner* task_graph_runner = task_graph_runner_; | 2152 TaskGraphRunner* task_graph_runner = task_graph_runner_; |
2152 if (is_synchronous_single_threaded_) { | 2153 if (is_synchronous_single_threaded_) { |
2153 DCHECK(!single_thread_synchronous_task_graph_runner_); | 2154 DCHECK(!single_thread_synchronous_task_graph_runner_); |
2154 single_thread_synchronous_task_graph_runner_.reset(new TaskGraphRunner); | 2155 single_thread_synchronous_task_graph_runner_.reset( |
| 2156 new SynchronousTaskGraphRunner); |
2155 task_graph_runner = single_thread_synchronous_task_graph_runner_.get(); | 2157 task_graph_runner = single_thread_synchronous_task_graph_runner_.get(); |
2156 } | 2158 } |
2157 | 2159 |
2158 ContextProvider* context_provider = output_surface_->context_provider(); | 2160 ContextProvider* context_provider = output_surface_->context_provider(); |
2159 if (!context_provider) { | 2161 if (!context_provider) { |
2160 *resource_pool = | 2162 *resource_pool = |
2161 ResourcePool::Create(resource_provider_.get(), GetTaskRunner()); | 2163 ResourcePool::Create(resource_provider_.get(), GetTaskRunner()); |
2162 | 2164 |
2163 *tile_task_worker_pool = BitmapTileTaskWorkerPool::Create( | 2165 *tile_task_worker_pool = BitmapTileTaskWorkerPool::Create( |
2164 GetTaskRunner(), task_graph_runner, resource_provider_.get()); | 2166 GetTaskRunner(), task_graph_runner, resource_provider_.get()); |
(...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3720 return task_runner_provider_->HasImplThread(); | 3722 return task_runner_provider_->HasImplThread(); |
3721 } | 3723 } |
3722 | 3724 |
3723 bool LayerTreeHostImpl::CommitToActiveTree() const { | 3725 bool LayerTreeHostImpl::CommitToActiveTree() const { |
3724 // In single threaded mode we skip the pending tree and commit directly to the | 3726 // In single threaded mode we skip the pending tree and commit directly to the |
3725 // active tree. | 3727 // active tree. |
3726 return !task_runner_provider_->HasImplThread(); | 3728 return !task_runner_provider_->HasImplThread(); |
3727 } | 3729 } |
3728 | 3730 |
3729 } // namespace cc | 3731 } // namespace cc |
OLD | NEW |