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

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

Issue 1890903002: cc: Simplify Task and its derived classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_tile_task_runner
Patch Set: feedback Created 4 years, 8 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "cc/raster/task_graph_runner.h"
6
7 #include <algorithm>
8 #include <utility>
9
10 #include "base/atomic_sequence_num.h"
11 #include "base/threading/thread_restrictions.h"
12 #include "base/trace_event/trace_event.h"
13
14 namespace cc {
15
16 Task::Task() : will_run_(false), did_run_(false) {}
17
18 Task::~Task() {
19 DCHECK(!will_run_);
20 }
21
22 void Task::WillRun() {
23 DCHECK(!will_run_);
24 DCHECK(!did_run_);
25 will_run_ = true;
26 }
27
28 void Task::DidRun() {
29 DCHECK(will_run_);
30 will_run_ = false;
31 did_run_ = true;
32 }
33
34 bool Task::HasFinishedRunning() const {
35 return did_run_;
36 }
37
38 TaskGraph::TaskGraph() {}
39
40 TaskGraph::TaskGraph(const TaskGraph& other) = default;
41
42 TaskGraph::~TaskGraph() {}
43
44 void TaskGraph::Swap(TaskGraph* other) {
45 nodes.swap(other->nodes);
46 edges.swap(other->edges);
47 }
48
49 void TaskGraph::Reset() {
50 nodes.clear();
51 edges.clear();
52 }
53
54 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698