| 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 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "cc/resources/rasterizer.h" | 10 #include "cc/resources/rasterizer.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 private: | 56 private: |
| 57 RasterTask::Vector completed_tasks_; | 57 RasterTask::Vector completed_tasks_; |
| 58 }; | 58 }; |
| 59 base::LazyInstance<FakeRasterizerImpl> g_fake_rasterizer = | 59 base::LazyInstance<FakeRasterizerImpl> g_fake_rasterizer = |
| 60 LAZY_INSTANCE_INITIALIZER; | 60 LAZY_INSTANCE_INITIALIZER; |
| 61 | 61 |
| 62 } // namespace | 62 } // namespace |
| 63 | 63 |
| 64 FakeTileManager::FakeTileManager(TileManagerClient* client) | 64 FakeTileManager::FakeTileManager(TileManagerClient* client) |
| 65 : TileManager(client, | 65 : TileManager(client, |
| 66 base::MessageLoopProxy::current(), |
| 66 NULL, | 67 NULL, |
| 67 g_fake_rasterizer.Pointer(), | 68 g_fake_rasterizer.Pointer(), |
| 68 g_fake_rasterizer.Pointer(), | 69 g_fake_rasterizer.Pointer(), |
| 69 true, | |
| 70 NULL) {} | 70 NULL) {} |
| 71 | 71 |
| 72 FakeTileManager::FakeTileManager(TileManagerClient* client, | 72 FakeTileManager::FakeTileManager(TileManagerClient* client, |
| 73 ResourcePool* resource_pool) | 73 ResourcePool* resource_pool) |
| 74 : TileManager(client, | 74 : TileManager(client, |
| 75 base::MessageLoopProxy::current(), |
| 75 resource_pool, | 76 resource_pool, |
| 76 g_fake_rasterizer.Pointer(), | 77 g_fake_rasterizer.Pointer(), |
| 77 g_fake_rasterizer.Pointer(), | 78 g_fake_rasterizer.Pointer(), |
| 78 true, | |
| 79 NULL) {} | |
| 80 | |
| 81 FakeTileManager::FakeTileManager(TileManagerClient* client, | |
| 82 ResourcePool* resource_pool, | |
| 83 bool allow_on_demand_raster) | |
| 84 : TileManager(client, | |
| 85 resource_pool, | |
| 86 g_fake_rasterizer.Pointer(), | |
| 87 g_fake_rasterizer.Pointer(), | |
| 88 allow_on_demand_raster, | |
| 89 NULL) {} | 79 NULL) {} |
| 90 | 80 |
| 91 FakeTileManager::~FakeTileManager() {} | 81 FakeTileManager::~FakeTileManager() {} |
| 92 | 82 |
| 93 void FakeTileManager::AssignMemoryToTiles( | 83 void FakeTileManager::AssignMemoryToTiles( |
| 94 const GlobalStateThatImpactsTilePriority& state) { | 84 const GlobalStateThatImpactsTilePriority& state) { |
| 95 tiles_for_raster.clear(); | 85 tiles_for_raster.clear(); |
| 96 all_tiles.Clear(); | 86 all_tiles.Clear(); |
| 97 | 87 |
| 98 SetGlobalStateForTesting(state); | 88 SetGlobalStateForTesting(state); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 109 void FakeTileManager::DidFinishRunningTasksForTesting() { | 99 void FakeTileManager::DidFinishRunningTasksForTesting() { |
| 110 DidFinishRunningTasks(); | 100 DidFinishRunningTasks(); |
| 111 } | 101 } |
| 112 | 102 |
| 113 void FakeTileManager::Release(Tile* tile) { | 103 void FakeTileManager::Release(Tile* tile) { |
| 114 TileManager::Release(tile); | 104 TileManager::Release(tile); |
| 115 CleanUpReleasedTiles(); | 105 CleanUpReleasedTiles(); |
| 116 } | 106 } |
| 117 | 107 |
| 118 } // namespace cc | 108 } // namespace cc |
| OLD | NEW |