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/resources/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 ImageDecodeTask
* TileTask::AsImageDecodeTask() {
23 RasterTask
* TileTask::AsRasterTask() {
27 void TileTask::WillSchedule() {
28 DCHECK(!did_schedule_
);
31 void TileTask::DidSchedule() {
33 did_complete_
= false;
36 bool TileTask::HasBeenScheduled() const {
40 void TileTask::WillComplete() {
41 DCHECK(!did_complete_
);
44 void TileTask::DidComplete() {
45 DCHECK(did_schedule_
);
46 DCHECK(!did_complete_
);
47 did_schedule_
= false;
51 bool TileTask::HasCompleted() const {
55 ImageDecodeTask::ImageDecodeTask() {
58 ImageDecodeTask::~ImageDecodeTask() {
61 ImageDecodeTask
* ImageDecodeTask::AsImageDecodeTask() {
65 RasterTask::RasterTask(const Resource
* resource
,
66 ImageDecodeTask::Vector
* dependencies
)
67 : resource_(resource
) {
68 dependencies_
.swap(*dependencies
);
71 RasterTask::~RasterTask() {
74 RasterTask
* RasterTask::AsRasterTask() {
78 TileTaskQueue::Item::Item(RasterTask
* task
, const TaskSetCollection
& task_sets
)
79 : task(task
), task_sets(task_sets
) {
80 DCHECK(task_sets
.any());
83 TileTaskQueue::Item::~Item() {
86 TileTaskQueue::TileTaskQueue() {
89 TileTaskQueue::~TileTaskQueue() {
92 void TileTaskQueue::Swap(TileTaskQueue
* other
) {
93 items
.swap(other
->items
);
96 void TileTaskQueue::Reset() {