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