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.
5 #include "cc/raster/tile_task_runner.h"
11 TileTask::TileTask() : did_schedule_(false), did_complete_(false) {
14 TileTask::~TileTask() {
15 DCHECK(!did_schedule_
);
16 DCHECK(!did_run_
|| did_complete_
);
19 void TileTask::WillSchedule() {
20 DCHECK(!did_schedule_
);
23 void TileTask::DidSchedule() {
25 did_complete_
= false;
28 bool TileTask::HasBeenScheduled() const {
32 void TileTask::WillComplete() {
33 DCHECK(!did_complete_
);
36 void TileTask::DidComplete() {
37 DCHECK(did_schedule_
);
38 DCHECK(!did_complete_
);
39 did_schedule_
= false;
43 bool TileTask::HasCompleted() const {
47 ImageDecodeTask::ImageDecodeTask() {
50 ImageDecodeTask::~ImageDecodeTask() {
53 RasterTask::RasterTask(ImageDecodeTask::Vector
* dependencies
) {
54 dependencies_
.swap(*dependencies
);
57 RasterTask::~RasterTask() {
60 TileTaskQueue::Item::Item(RasterTask
* task
, const TaskSetCollection
& task_sets
)
61 : task(task
), task_sets(task_sets
) {
62 DCHECK(task_sets
.any());
65 TileTaskQueue::Item::~Item() {
68 TileTaskQueue::TileTaskQueue() {
71 TileTaskQueue::~TileTaskQueue() {
74 void TileTaskQueue::Swap(TileTaskQueue
* other
) {
75 items
.swap(other
->items
);
78 void TileTaskQueue::Reset() {