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

Side by Side Diff: cc/raster/task_graph_runner.h

Issue 1521423003: Revert of TaskGraphRunner Group support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor
Patch Set: Created 5 years 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
« no previous file with comments | « cc/raster/synchronous_task_graph_runner.cc ('k') | cc/raster/task_graph_runner_perftest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CC_RASTER_TASK_GRAPH_RUNNER_H_ 5 #ifndef CC_RASTER_TASK_GRAPH_RUNNER_H_
6 #define CC_RASTER_TASK_GRAPH_RUNNER_H_ 6 #define CC_RASTER_TASK_GRAPH_RUNNER_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 28 matching lines...) Expand all
39 39
40 Task(); 40 Task();
41 virtual ~Task(); 41 virtual ~Task();
42 42
43 bool will_run_; 43 bool will_run_;
44 bool did_run_; 44 bool did_run_;
45 }; 45 };
46 46
47 // A task dependency graph describes the order in which to execute a set 47 // A task dependency graph describes the order in which to execute a set
48 // of tasks. Dependencies are represented as edges. Each node is assigned 48 // of tasks. Dependencies are represented as edges. Each node is assigned
49 // a category, a priority and a run count that matches the number of 49 // a priority and a run count that matches the number of dependencies.
50 // dependencies. Priority range from 0 (most favorable scheduling) to UINT16_MAX 50 // Priority range from 0 (most favorable scheduling) to UINT_MAX
51 // (least favorable). Categories range from 0 to UINT16_MAX. It is up to the 51 // (least favorable).
52 // implementation and its consumer to determine the meaning (if any) of a
53 // category. A TaskGraphRunner implementation may chose to prioritize certain
54 // categories over others, regardless of the individual priorities of tasks.
55 struct CC_EXPORT TaskGraph { 52 struct CC_EXPORT TaskGraph {
56 struct Node { 53 struct Node {
57 typedef std::vector<Node> Vector; 54 typedef std::vector<Node> Vector;
58 55
59 Node(Task* task, 56 Node(Task* task, size_t priority, size_t dependencies)
60 uint16_t category, 57 : task(task), priority(priority), dependencies(dependencies) {}
61 uint16_t priority,
62 uint32_t dependencies)
63 : task(task),
64 category(category),
65 priority(priority),
66 dependencies(dependencies) {}
67 58
68 Task* task; 59 Task* task;
69 uint16_t category; 60 size_t priority;
70 uint16_t priority; 61 size_t dependencies;
71 uint32_t dependencies;
72 }; 62 };
73 63
74 struct Edge { 64 struct Edge {
75 typedef std::vector<Edge> Vector; 65 typedef std::vector<Edge> Vector;
76 66
77 Edge(const Task* task, Task* dependent) 67 Edge(const Task* task, Task* dependent)
78 : task(task), dependent(dependent) {} 68 : task(task), dependent(dependent) {}
79 69
80 const Task* task; 70 const Task* task;
81 Task* dependent; 71 Task* dependent;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 private: 203 private:
214 TaskGraph* graph_; 204 TaskGraph* graph_;
215 const Task* task_; 205 const Task* task_;
216 size_t current_index_; 206 size_t current_index_;
217 TaskGraph::Node* current_node_; 207 TaskGraph::Node* current_node_;
218 }; 208 };
219 209
220 } // namespace cc 210 } // namespace cc
221 211
222 #endif // CC_RASTER_TASK_GRAPH_RUNNER_H_ 212 #endif // CC_RASTER_TASK_GRAPH_RUNNER_H_
OLDNEW
« no previous file with comments | « cc/raster/synchronous_task_graph_runner.cc ('k') | cc/raster/task_graph_runner_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698