Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(260)

Side by Side Diff: cc/resources/raster_worker_pool.cc

Issue 523243002: cc: Generalize raster task notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean-ups Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698