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

Unified Diff: cc/tiles/tile_manager.cc

Issue 1796423002: Handle out of order tile priorities when building graph (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback Created 4 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/tile_manager.cc
diff --git a/cc/tiles/tile_manager.cc b/cc/tiles/tile_manager.cc
index e950484d16003df35daf1d6aad08dec849c8f4d7..fa93c3d249fb53c54520942d041f7e94bbe27ee3 100644
--- a/cc/tiles/tile_manager.cc
+++ b/cc/tiles/tile_manager.cc
@@ -197,11 +197,15 @@ void InsertNodesForRasterTask(TaskGraph* graph,
return node.task == decode_task;
});
- // Tasks are inserted in priority order, so existing decode tasks should
- // already be FOREGROUND if this is a high priority task.
- DCHECK(decode_it == graph->nodes.end() || !high_priority ||
- static_cast<uint16_t>(TASK_CATEGORY_FOREGROUND) ==
- decode_it->category);
+ // In rare circumstances, a low priority task may come in before a high
+ // priority task. In these cases, upgrade any low-priority dependencies of
+ // the current task.
+ // TODO(ericrk): Task iterators should be updated to avoid this.
+ // crbug.com/594851
+ if (decode_it != graph->nodes.end() && high_priority &&
+ decode_it->category != decode_task_category) {
+ decode_it->category = decode_task_category;
+ }
if (decode_it == graph->nodes.end()) {
InsertNodeForTask(graph, decode_task, decode_task_category, priority, 0u);
@@ -772,8 +776,12 @@ void TileManager::ScheduleTasks(
all_count++;
graph_.edges.push_back(TaskGraph::Edge(task, all_done_task.get()));
+ // A tile is high priority if it is either blocking future compositing
+ // (required for draw or required for activation), or if it has a priority
+ // bin of NOW for another reason (low resolution tiles).
bool high_priority =
- tile->required_for_draw() || tile->required_for_activation();
+ tile->required_for_draw() || tile->required_for_activation() ||
+ prioritized_tile.priority().priority_bin == TilePriority::NOW;
InsertNodesForRasterTask(&graph_, task, task->dependencies(), priority++,
use_gpu_rasterization_, high_priority);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698