Revert "Reland c91b178b07b0d - Delete dead signin code (SigninGlobalError)"
[chromium-blink-merge.git] / cc / raster / tile_task_runner.cc
blob5450c5f777e0a880a0e3e096bd42fb65524e8a12
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"
7 #include <algorithm>
9 namespace cc {
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() {
20 return NULL;
23 RasterTask* TileTask::AsRasterTask() {
24 return NULL;
27 void TileTask::WillSchedule() {
28 DCHECK(!did_schedule_);
31 void TileTask::DidSchedule() {
32 did_schedule_ = true;
33 did_complete_ = false;
36 bool TileTask::HasBeenScheduled() const {
37 return did_schedule_;
40 void TileTask::WillComplete() {
41 DCHECK(!did_complete_);
44 void TileTask::DidComplete() {
45 DCHECK(did_schedule_);
46 DCHECK(!did_complete_);
47 did_schedule_ = false;
48 did_complete_ = true;
51 bool TileTask::HasCompleted() const {
52 return did_complete_;
55 ImageDecodeTask::ImageDecodeTask() {
58 ImageDecodeTask::~ImageDecodeTask() {
61 ImageDecodeTask* ImageDecodeTask::AsImageDecodeTask() {
62 return this;
65 RasterTask::RasterTask(const Resource* resource,
66 ImageDecodeTask::Vector* dependencies)
67 : resource_(resource) {
68 dependencies_.swap(*dependencies);
71 RasterTask::~RasterTask() {
74 RasterTask* RasterTask::AsRasterTask() {
75 return this;
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() {
97 items.clear();
100 } // namespace cc