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(); |