| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/test/fake_tile_manager.h" | 5 #include "cc/test/fake_tile_manager.h" |
| 6 | 6 |
| 7 #include <deque> | 7 #include <deque> |
| 8 #include <limits> | 8 #include <limits> |
| 9 | 9 |
| 10 #include "cc/resources/raster_worker_pool.h" | 10 #include "cc/resources/raster_worker_pool.h" |
| 11 | 11 |
| 12 namespace cc { | 12 namespace cc { |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 class FakeRasterWorkerPool : public RasterWorkerPool { | 16 class FakeRasterWorkerPool : public RasterWorkerPool { |
| 17 public: | 17 public: |
| 18 FakeRasterWorkerPool() : RasterWorkerPool(NULL, NULL) {} | 18 FakeRasterWorkerPool() : RasterWorkerPool(NULL, NULL) {} |
| 19 | 19 |
| 20 // Overridden from RasterWorkerPool: | 20 // Overridden from RasterWorkerPool: |
| 21 virtual void ScheduleTasks(RasterTask::Queue* queue) OVERRIDE { | 21 virtual void ScheduleTasks(RasterTaskQueue* queue) OVERRIDE { |
| 22 for (RasterTaskQueueIterator it(queue); it; ++it) { | 22 for (RasterTaskQueue::Item::Vector::const_iterator it = |
| 23 internal::RasterWorkerPoolTask* task = *it; | 23 queue->items.begin(); |
| 24 it != queue->items.end(); |
| 25 ++it) { |
| 26 internal::RasterWorkerPoolTask* task = it->task; |
| 24 | 27 |
| 25 task->DidSchedule(); | 28 task->DidSchedule(); |
| 26 | 29 |
| 27 completed_tasks_.push_back(task); | 30 completed_tasks_.push_back(task); |
| 28 } | 31 } |
| 29 } | 32 } |
| 30 virtual void CheckForCompletedTasks() OVERRIDE { | 33 virtual void CheckForCompletedTasks() OVERRIDE { |
| 31 while (!completed_tasks_.empty()) { | 34 while (!completed_tasks_.empty()) { |
| 32 internal::WorkerPoolTask* task = completed_tasks_.front().get(); | 35 internal::WorkerPoolTask* task = completed_tasks_.front().get(); |
| 33 | 36 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 void FakeTileManager::DidFinishRunningTasksForTesting() { | 135 void FakeTileManager::DidFinishRunningTasksForTesting() { |
| 133 DidFinishRunningTasks(); | 136 DidFinishRunningTasks(); |
| 134 } | 137 } |
| 135 | 138 |
| 136 void FakeTileManager::Release(Tile* tile) { | 139 void FakeTileManager::Release(Tile* tile) { |
| 137 TileManager::Release(tile); | 140 TileManager::Release(tile); |
| 138 CleanUpReleasedTiles(); | 141 CleanUpReleasedTiles(); |
| 139 } | 142 } |
| 140 | 143 |
| 141 } // namespace cc | 144 } // namespace cc |
| OLD | NEW |