OLD | NEW |
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/tile_task.h" | 5 #include "cc/raster/tile_task.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
11 TileTask::TileTask(bool supports_concurrent_execution) | 11 TileTask::TileTask(bool supports_concurrent_execution) |
12 : supports_concurrent_execution_(supports_concurrent_execution), | 12 : supports_concurrent_execution_(supports_concurrent_execution) {} |
13 did_schedule_(false), | |
14 did_complete_(false) {} | |
15 | 13 |
16 TileTask::TileTask(bool supports_concurrent_execution, | 14 TileTask::TileTask(bool supports_concurrent_execution, |
17 TileTask::Vector* dependencies) | 15 TileTask::Vector* dependencies) |
18 : supports_concurrent_execution_(supports_concurrent_execution), | 16 : supports_concurrent_execution_(supports_concurrent_execution), |
19 dependencies_(std::move(*dependencies)), | 17 dependencies_(std::move(*dependencies)) {} |
20 did_schedule_(false), | |
21 did_complete_(false) {} | |
22 | 18 |
23 TileTask::~TileTask() { | 19 TileTask::~TileTask() {} |
24 DCHECK(!did_schedule_); | |
25 DCHECK(!state().IsFinished() || did_complete_); | |
26 } | |
27 | |
28 void TileTask::WillSchedule() { | |
29 DCHECK(!did_schedule_); | |
30 } | |
31 | |
32 void TileTask::DidSchedule() { | |
33 did_schedule_ = true; | |
34 did_complete_ = false; | |
35 } | |
36 | |
37 bool TileTask::HasBeenScheduled() const { | |
38 return did_schedule_; | |
39 } | |
40 | |
41 void TileTask::WillComplete() { | |
42 DCHECK(!did_complete_); | |
43 } | |
44 | |
45 void TileTask::DidComplete() { | |
46 DCHECK(did_schedule_); | |
47 DCHECK(!did_complete_); | |
48 did_schedule_ = false; | |
49 did_complete_ = true; | |
50 } | |
51 | |
52 bool TileTask::HasCompleted() const { | |
53 return did_complete_; | |
54 } | |
55 | 20 |
56 } // namespace cc | 21 } // namespace cc |
OLD | NEW |