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

Side by Side Diff: cc/raster/task_graph_work_queue.cc

Issue 1866043006: cc: Remove ScheduleOnOriginThread() and CompleteOnOriginThread(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 7 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 unified diff | Download patch
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 #include "cc/raster/task_graph_work_queue.h" 5 #include "cc/raster/task_graph_work_queue.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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 } 182 }
183 183
184 // Swap task graph. 184 // Swap task graph.
185 task_namespace.graph.Swap(graph); 185 task_namespace.graph.Swap(graph);
186 186
187 // Determine what tasks in old graph need to be canceled. 187 // Determine what tasks in old graph need to be canceled.
188 for (TaskGraph::Node::Vector::iterator it = graph->nodes.begin(); 188 for (TaskGraph::Node::Vector::iterator it = graph->nodes.begin();
189 it != graph->nodes.end(); ++it) { 189 it != graph->nodes.end(); ++it) {
190 TaskGraph::Node& node = *it; 190 TaskGraph::Node& node = *it;
191 191
192 // Skip if already finished running task. 192 // Skip if already finished or completed.
193 if (node.task->state().IsFinished()) 193 if (node.task->state().IsFinished() || node.task->state().IsCompleted())
194 continue; 194 continue;
195 195
196 // Skip if already running. 196 // Skip if already running.
197 if (std::any_of(task_namespace.running_tasks.begin(), 197 if (std::any_of(task_namespace.running_tasks.begin(),
198 task_namespace.running_tasks.end(), 198 task_namespace.running_tasks.end(),
199 [&node](const CategorizedTask& task) { 199 [&node](const CategorizedTask& task) {
200 return task.second == node.task; 200 return task.second == node.task;
201 })) 201 }))
202 continue; 202 continue;
203 203
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 for (const TaskGraph::Node& node : graph->nodes) { 368 for (const TaskGraph::Node& node : graph->nodes) {
369 if (dependents[node.task] != node.dependencies) 369 if (dependents[node.task] != node.dependencies)
370 return true; 370 return true;
371 } 371 }
372 372
373 return false; 373 return false;
374 } 374 }
375 375
376 } // namespace cc 376 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698