Explicitly add python-numpy dependency to install-build-deps.
[chromium-blink-merge.git] / cc / resources / rasterizer.cc
blob4ce8987e8ca95385c8863d685163714a3a48f499
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/rasterizer.h"
7 #include <algorithm>
9 namespace cc {
11 RasterizerTask::RasterizerTask() : did_schedule_(false), did_complete_(false) {}
13 RasterizerTask::~RasterizerTask() {
14 // Debugging CHECKs to help track down a use-after-free.
15 CHECK(!did_schedule_);
16 CHECK(!did_run_ || did_complete_);
19 ImageDecodeTask* RasterizerTask::AsImageDecodeTask() { return NULL; }
21 RasterTask* RasterizerTask::AsRasterTask() { return NULL; }
23 void RasterizerTask::WillSchedule() { DCHECK(!did_schedule_); }
25 void RasterizerTask::DidSchedule() {
26 did_schedule_ = true;
27 did_complete_ = false;
30 bool RasterizerTask::HasBeenScheduled() const { return did_schedule_; }
32 void RasterizerTask::WillComplete() { DCHECK(!did_complete_); }
34 void RasterizerTask::DidComplete() {
35 DCHECK(did_schedule_);
36 DCHECK(!did_complete_);
37 did_schedule_ = false;
38 did_complete_ = true;
41 bool RasterizerTask::HasCompleted() const { return did_complete_; }
43 ImageDecodeTask::ImageDecodeTask() {}
45 ImageDecodeTask::~ImageDecodeTask() {}
47 ImageDecodeTask* ImageDecodeTask::AsImageDecodeTask() { return this; }
49 RasterTask::RasterTask(const Resource* resource,
50 ImageDecodeTask::Vector* dependencies)
51 : resource_(resource) {
52 dependencies_.swap(*dependencies);
55 RasterTask::~RasterTask() {}
57 RasterTask* RasterTask::AsRasterTask() { return this; }
59 RasterTaskQueue::Item::Item(RasterTask* task,
60 const TaskSetCollection& task_sets)
61 : task(task), task_sets(task_sets) {
62 DCHECK(task_sets.any());
65 RasterTaskQueue::Item::~Item() {}
67 RasterTaskQueue::RasterTaskQueue() {
70 RasterTaskQueue::~RasterTaskQueue() {}
72 void RasterTaskQueue::Swap(RasterTaskQueue* other) {
73 items.swap(other->items);
76 void RasterTaskQueue::Reset() {
77 items.clear();
80 } // namespace cc