OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/resources/raster_worker_pool.h" | 5 #include "cc/resources/raster_worker_pool.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } // namespace | 89 } // namespace |
90 | 90 |
91 // This allows an external rasterize on-demand system to run raster tasks | 91 // This allows an external rasterize on-demand system to run raster tasks |
92 // with highest priority using the same task graph runner instance. | 92 // with highest priority using the same task graph runner instance. |
93 unsigned RasterWorkerPool::kOnDemandRasterTaskPriority = 0u; | 93 unsigned RasterWorkerPool::kOnDemandRasterTaskPriority = 0u; |
94 // This allows a micro benchmark system to run tasks with highest priority, | 94 // This allows a micro benchmark system to run tasks with highest priority, |
95 // since it should finish as quickly as possible. | 95 // since it should finish as quickly as possible. |
96 unsigned RasterWorkerPool::kBenchmarkRasterTaskPriority = 0u; | 96 unsigned RasterWorkerPool::kBenchmarkRasterTaskPriority = 0u; |
97 // Task priorities that make sure raster finished tasks run before any | 97 // Task priorities that make sure raster finished tasks run before any |
98 // remaining raster tasks. | 98 // remaining raster tasks. |
99 unsigned RasterWorkerPool::kRasterFinishedTaskPriority = 2u; | 99 unsigned RasterWorkerPool::kRasterFinishedTaskPriority = 1u; |
100 unsigned RasterWorkerPool::kRasterRequiredForActivationFinishedTaskPriority = | 100 unsigned RasterWorkerPool::kRasterTaskPriorityBase = 2u; |
101 1u; | |
102 unsigned RasterWorkerPool::kRasterTaskPriorityBase = 3u; | |
103 | 101 |
104 RasterWorkerPool::RasterWorkerPool() {} | 102 RasterWorkerPool::RasterWorkerPool() {} |
105 | 103 |
106 RasterWorkerPool::~RasterWorkerPool() {} | 104 RasterWorkerPool::~RasterWorkerPool() {} |
107 | 105 |
108 // static | 106 // static |
109 void RasterWorkerPool::SetNumRasterThreads(int num_threads) { | 107 void RasterWorkerPool::SetNumRasterThreads(int num_threads) { |
110 DCHECK_LT(0, num_threads); | 108 DCHECK_LT(0, num_threads); |
111 DCHECK_EQ(0, g_num_raster_threads); | 109 DCHECK_EQ(0, g_num_raster_threads); |
112 | 110 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 if (decode_it == graph->nodes.end()) | 191 if (decode_it == graph->nodes.end()) |
194 InsertNodeForTask(graph, decode_task, priority, 0u); | 192 InsertNodeForTask(graph, decode_task, priority, 0u); |
195 | 193 |
196 graph->edges.push_back(TaskGraph::Edge(decode_task, raster_task)); | 194 graph->edges.push_back(TaskGraph::Edge(decode_task, raster_task)); |
197 } | 195 } |
198 | 196 |
199 InsertNodeForTask(graph, raster_task, priority, dependencies); | 197 InsertNodeForTask(graph, raster_task, priority, dependencies); |
200 } | 198 } |
201 | 199 |
202 } // namespace cc | 200 } // namespace cc |
OLD | NEW |