| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 base::MessageLoopProxy::current(), | 74 base::MessageLoopProxy::current(), |
| 75 resource_pool, | 75 resource_pool, |
| 76 g_fake_rasterizer.Pointer(), | 76 g_fake_rasterizer.Pointer(), |
| 77 NULL) {} | 77 NULL) {} |
| 78 | 78 |
| 79 FakeTileManager::~FakeTileManager() {} | 79 FakeTileManager::~FakeTileManager() {} |
| 80 | 80 |
| 81 void FakeTileManager::AssignMemoryToTiles( | 81 void FakeTileManager::AssignMemoryToTiles( |
| 82 const GlobalStateThatImpactsTilePriority& state) { | 82 const GlobalStateThatImpactsTilePriority& state) { |
| 83 tiles_for_raster.clear(); | 83 tiles_for_raster.clear(); |
| 84 all_tiles.Clear(); | |
| 85 | 84 |
| 86 SetGlobalStateForTesting(state); | 85 SetGlobalStateForTesting(state); |
| 87 GetTilesWithAssignedBins(&all_tiles); | 86 AssignGpuMemoryToTiles(&tiles_for_raster); |
| 88 AssignGpuMemoryToTiles(&all_tiles, &tiles_for_raster); | |
| 89 } | 87 } |
| 90 | 88 |
| 91 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { | 89 bool FakeTileManager::HasBeenAssignedMemory(Tile* tile) { |
| 92 return std::find(tiles_for_raster.begin(), | 90 return std::find(tiles_for_raster.begin(), |
| 93 tiles_for_raster.end(), | 91 tiles_for_raster.end(), |
| 94 tile) != tiles_for_raster.end(); | 92 tile) != tiles_for_raster.end(); |
| 95 } | 93 } |
| 96 | 94 |
| 97 void FakeTileManager::DidFinishRunningTasksForTesting() { | 95 void FakeTileManager::DidFinishRunningTasksForTesting() { |
| 98 DidFinishRunningTasks(); | 96 DidFinishRunningTasks(); |
| 99 } | 97 } |
| 100 | 98 |
| 101 void FakeTileManager::Release(Tile* tile) { | 99 void FakeTileManager::Release(Tile* tile) { |
| 102 TileManager::Release(tile); | 100 TileManager::Release(tile); |
| 103 CleanUpReleasedTiles(); | 101 CleanUpReleasedTiles(); |
| 104 } | 102 } |
| 105 | 103 |
| 106 } // namespace cc | 104 } // namespace cc |
| OLD | NEW |