Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Side by Side Diff: cc/test/fake_tile_manager.cc

Issue 246673005: cc: Start using raster/eviction iterators in tile manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« cc/resources/tile_priority.h ('K') | « cc/test/fake_tile_manager.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« cc/resources/tile_priority.h ('K') | « cc/test/fake_tile_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698