Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/tiles/tile_manager.h" | 5 #include "cc/tiles/tile_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 | 188 |
| 189 dependencies++; | 189 dependencies++; |
| 190 | 190 |
| 191 // Add decode task if it doesn't already exists in graph. | 191 // Add decode task if it doesn't already exists in graph. |
| 192 TaskGraph::Node::Vector::iterator decode_it = | 192 TaskGraph::Node::Vector::iterator decode_it = |
| 193 std::find_if(graph->nodes.begin(), graph->nodes.end(), | 193 std::find_if(graph->nodes.begin(), graph->nodes.end(), |
| 194 [decode_task](const TaskGraph::Node& node) { | 194 [decode_task](const TaskGraph::Node& node) { |
| 195 return node.task == decode_task; | 195 return node.task == decode_task; |
| 196 }); | 196 }); |
| 197 | 197 |
| 198 // Tasks are inserted in priority order, so existing decode tasks should | 198 // In rare circumstances, a low priority task may come in before a high |
| 199 // already be FOREGROUND if this is a high priority task. | 199 // priority task. In these cases, upgrade any low-priority dependencies of |
| 200 DCHECK(decode_it == graph->nodes.end() || !high_priority || | 200 // the current task. |
| 201 static_cast<uint16_t>(TASK_CATEGORY_FOREGROUND) == | 201 // TODO(ericrk): Task iterators should be updated to avoid this. |
| 202 decode_it->category); | 202 // crbug.com/594851 |
| 203 if (decode_it != graph->nodes.end() && high_priority && | |
| 204 decode_it->category != static_cast<uint16_t>(decode_task_category)) { | |
|
vmpstr
2016/03/21 19:44:50
Why is static_cast required here? (and not below?)
ericrk
2016/03/24 17:56:04
I guess it's not... I must not have checked :D
| |
| 205 decode_it->category = decode_task_category; | |
| 206 } | |
| 203 | 207 |
| 204 if (decode_it == graph->nodes.end()) { | 208 if (decode_it == graph->nodes.end()) { |
| 205 InsertNodeForTask(graph, decode_task, decode_task_category, priority, 0u); | 209 InsertNodeForTask(graph, decode_task, decode_task_category, priority, 0u); |
| 206 } | 210 } |
| 207 | 211 |
| 208 graph->edges.push_back(TaskGraph::Edge(decode_task, raster_task)); | 212 graph->edges.push_back(TaskGraph::Edge(decode_task, raster_task)); |
| 209 } | 213 } |
| 210 | 214 |
| 211 InsertNodeForTask(graph, raster_task, raster_task_category, priority, | 215 InsertNodeForTask(graph, raster_task, raster_task_category, priority, |
| 212 dependencies); | 216 dependencies); |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 761 TaskGraph::Edge(task, required_for_activation_done_task.get())); | 765 TaskGraph::Edge(task, required_for_activation_done_task.get())); |
| 762 } | 766 } |
| 763 if (tile->required_for_draw()) { | 767 if (tile->required_for_draw()) { |
| 764 required_for_draw_count++; | 768 required_for_draw_count++; |
| 765 graph_.edges.push_back( | 769 graph_.edges.push_back( |
| 766 TaskGraph::Edge(task, required_for_draw_done_task.get())); | 770 TaskGraph::Edge(task, required_for_draw_done_task.get())); |
| 767 } | 771 } |
| 768 all_count++; | 772 all_count++; |
| 769 graph_.edges.push_back(TaskGraph::Edge(task, all_done_task.get())); | 773 graph_.edges.push_back(TaskGraph::Edge(task, all_done_task.get())); |
| 770 | 774 |
| 775 // A tile is high priority if it is either blocking future compositing | |
| 776 // (requierd for draw or required for activation), or if it has a priority | |
|
vmpstr
2016/03/21 19:44:51
s/requierd/required/
ericrk
2016/03/24 17:56:04
Done.
| |
| 777 // bin of NOW for another reason (low resolution tiles). | |
| 771 bool high_priority = | 778 bool high_priority = |
| 772 tile->required_for_draw() || tile->required_for_activation(); | 779 tile->required_for_draw() || tile->required_for_activation() || |
| 780 prioritized_tile.priority().priority_bin == TilePriority::NOW; | |
| 773 InsertNodesForRasterTask(&graph_, task, task->dependencies(), priority++, | 781 InsertNodesForRasterTask(&graph_, task, task->dependencies(), priority++, |
| 774 use_gpu_rasterization_, high_priority); | 782 use_gpu_rasterization_, high_priority); |
| 775 } | 783 } |
| 776 | 784 |
| 777 // Insert nodes for our task completion tasks. We enqueue these using | 785 // Insert nodes for our task completion tasks. We enqueue these using |
| 778 // FOREGROUND priority as they are relatively quick tasks and we'd like | 786 // FOREGROUND priority as they are relatively quick tasks and we'd like |
| 779 // to trigger our callbacks quickly to aid in scheduling. | 787 // to trigger our callbacks quickly to aid in scheduling. |
| 780 InsertNodeForTask(&graph_, required_for_activation_done_task.get(), | 788 InsertNodeForTask(&graph_, required_for_activation_done_task.get(), |
| 781 TASK_CATEGORY_FOREGROUND, | 789 TASK_CATEGORY_FOREGROUND, |
| 782 kRequiredForActivationDoneTaskPriority, | 790 kRequiredForActivationDoneTaskPriority, |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1193 void TileManager::Signals::reset() { | 1201 void TileManager::Signals::reset() { |
| 1194 ready_to_activate = false; | 1202 ready_to_activate = false; |
| 1195 did_notify_ready_to_activate = false; | 1203 did_notify_ready_to_activate = false; |
| 1196 ready_to_draw = false; | 1204 ready_to_draw = false; |
| 1197 did_notify_ready_to_draw = false; | 1205 did_notify_ready_to_draw = false; |
| 1198 all_tile_tasks_completed = false; | 1206 all_tile_tasks_completed = false; |
| 1199 did_notify_all_tile_tasks_completed = false; | 1207 did_notify_all_tile_tasks_completed = false; |
| 1200 } | 1208 } |
| 1201 | 1209 |
| 1202 } // namespace cc | 1210 } // namespace cc |
| OLD | NEW |