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, 1) {} | 18 FakeRasterWorkerPool() : RasterWorkerPool(NULL, NULL, 1) {} |
19 | 19 |
20 virtual void ScheduleTasks(RasterTask::Queue* queue) OVERRIDE { | 20 virtual void ScheduleTasks(RasterTask::Queue* queue) OVERRIDE { |
21 RasterWorkerPool::SetRasterTasks(queue); | 21 RasterWorkerPool::SetRasterTasks(queue); |
22 for (RasterTaskVector::const_iterator it = raster_tasks().begin(); | 22 for (RasterTaskVector::const_iterator it = raster_tasks().begin(); |
23 it != raster_tasks().end(); ++it) { | 23 it != raster_tasks().end(); ++it) { |
24 completed_tasks_.push_back(it->get()); | 24 completed_tasks_.push_back(it->get()); |
25 } | 25 } |
26 } | 26 } |
27 virtual void CheckForCompletedTasks() OVERRIDE { | 27 virtual void CheckForCompletedTasks() OVERRIDE { |
28 while (!completed_tasks_.empty()) { | 28 while (!completed_tasks_.empty()) { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 108 } |
109 | 109 |
110 void FakeTileManager::Release(TileBundle* bundle) { | 110 void FakeTileManager::Release(TileBundle* bundle) { |
111 TileManager::Release(bundle); | 111 TileManager::Release(bundle); |
112 in_bundle_cleanup_ = true; | 112 in_bundle_cleanup_ = true; |
113 CleanUpReleasedTiles(); | 113 CleanUpReleasedTiles(); |
114 in_bundle_cleanup_ = false; | 114 in_bundle_cleanup_ = false; |
115 } | 115 } |
116 | 116 |
117 } // namespace cc | 117 } // namespace cc |
OLD | NEW |