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

Unified Diff: cc/raster/synchronous_task_graph_runner.cc

Issue 1489233003: TaskGraphRunner Group support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor
Patch Set: feedback 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 side-by-side diff with in-line comments
Download patch
Index: cc/raster/synchronous_task_graph_runner.cc
diff --git a/cc/raster/synchronous_task_graph_runner.cc b/cc/raster/synchronous_task_graph_runner.cc
index ed05cfb5823127277020491b4b5fbb0d6e3abbd2..4c4c8ca673e7d79bfc74ff872747318167bc5056 100644
--- a/cc/raster/synchronous_task_graph_runner.cc
+++ b/cc/raster/synchronous_task_graph_runner.cc
@@ -7,6 +7,7 @@
#include "base/threading/simple_thread.h"
#include "base/threading/thread_restrictions.h"
#include "base/trace_event/trace_event.h"
+#include "cc/raster/task_category.h"
namespace cc {
@@ -64,7 +65,16 @@ void SynchronousTaskGraphRunner::RunUntilIdle() {
void SynchronousTaskGraphRunner::RunTask() {
TRACE_EVENT0("toplevel", "SynchronousTaskGraphRunner::RunTask");
- auto prioritized_task = work_queue_.GetNextTaskToRun();
+ // Find the first category with any tasks to run. Categories used by this task
+ // graph runner are ordered by priority.
+ uint16_t category;
+ for (category = 0u; category < kNumTaskCategories; ++category) {
reveman 2015/12/10 16:49:57 I'd like to avoid making the kNumTaskCategories as
ericrk 2015/12/14 19:40:57 What do you think about this approach? It's a bit
+ if (work_queue_.HasReadyToRunTasksForCategory(category))
+ break;
+ }
+ DCHECK(category < kNumTaskCategories);
+
+ auto prioritized_task = work_queue_.GetNextTaskToRun(category);
Task* task = prioritized_task.task;
task->WillRun();

Powered by Google App Engine
This is Rietveld 408576698