| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 resource_pool, | 83 resource_pool, |
| 84 g_fake_rasterizer.Pointer(), | 84 g_fake_rasterizer.Pointer(), |
| 85 allow_on_demand_raster, | 85 allow_on_demand_raster, |
| 86 NULL) {} | 86 NULL) {} |
| 87 | 87 |
| 88 FakeTileManager::~FakeTileManager() {} | 88 FakeTileManager::~FakeTileManager() {} |
| 89 | 89 |
| 90 void FakeTileManager::AssignMemoryToTiles( | 90 void FakeTileManager::AssignMemoryToTiles( |
| 91 const GlobalStateThatImpactsTilePriority& state) { | 91 const GlobalStateThatImpactsTilePriority& state) { |
| 92 tiles_for_raster.clear(); | 92 tiles_for_raster.clear(); |
| 93 all_tiles.Clear(); | |
| 94 | 93 |
| 95 SetGlobalStateForTesting(state); | 94 SetGlobalStateForTesting(state); |
| 96 GetTilesWithAssignedBins(&all_tiles); | 95 AssignGpuMemoryToTiles(&tiles_for_raster); |
| 97 AssignGpuMemoryToTiles(&all_tiles, &tiles_for_raster); | |
| 98 } | 96 } |
| 99 | 97 |
| 100 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { | 98 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { |
| 101 return std::find(tiles_for_raster.begin(), | 99 return std::find(tiles_for_raster.begin(), |
| 102 tiles_for_raster.end(), | 100 tiles_for_raster.end(), |
| 103 tile) != tiles_for_raster.end(); | 101 tile) != tiles_for_raster.end(); |
| 104 } | 102 } |
| 105 | 103 |
| 106 void FakeTileManager::DidFinishRunningTasksForTesting() { | 104 void FakeTileManager::DidFinishRunningTasksForTesting() { |
| 107 DidFinishRunningTasks(); | 105 DidFinishRunningTasks(); |
| 108 } | 106 } |
| 109 | 107 |
| 110 void FakeTileManager::Release(Tile* tile) { | 108 void FakeTileManager::Release(Tile* tile) { |
| 111 TileManager::Release(tile); | 109 TileManager::Release(tile); |
| 112 CleanUpReleasedTiles(); | 110 CleanUpReleasedTiles(); |
| 113 } | 111 } |
| 114 | 112 |
| 115 } // namespace cc | 113 } // namespace cc |
| OLD | NEW |