Index: cc/resources/tile_manager.cc |
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc |
index 6b108d8248fd672099f3d6b1c6a2aa02eefca2a9..10a223014af43adfd1cdbc92a10a9e5606698570 100644 |
--- a/cc/resources/tile_manager.cc |
+++ b/cc/resources/tile_manager.cc |
@@ -25,7 +25,8 @@ namespace cc { |
namespace { |
// Memory limit policy works by mapping some bin states to the NEVER bin. |
-const ManagedTileBin kBinPolicyMap[NUM_TILE_MEMORY_LIMIT_POLICIES][NUM_BINS] = { |
+const ManagedTileBin kBinPolicyMap |
+ [TileMemoryLimitPolicy_ARRAYSIZE][ManagedTileBin_ARRAYSIZE] = { |
{ // [ALLOW_NOTHING] |
NEVER_BIN, // [NOW_AND_READY_TO_DRAW_BIN] |
NEVER_BIN, // [NOW_BIN] |
@@ -535,7 +536,7 @@ void TileManager::AssignGpuMemoryToTiles( |
size_t tile_resources = 0; |
// It costs to maintain a resource. |
- for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
+ for (int mode = 0; mode < RasterMode_ARRAYSIZE; ++mode) { |
if (mts.tile_versions[mode].resource_) { |
tile_bytes += tile->bytes_consumed_if_allocated(); |
tile_resources++; |
@@ -653,23 +654,22 @@ void TileManager::FreeResourceForTile(Tile* tile, RasterMode mode) { |
} |
void TileManager::FreeResourcesForTile(Tile* tile) { |
- for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
+ for (int mode = 0; mode < RasterMode_ARRAYSIZE; ++mode) |
FreeResourceForTile(tile, static_cast<RasterMode>(mode)); |
- } |
} |
void TileManager::FreeUnusedResourcesForTile(Tile* tile) { |
DCHECK(tile->IsReadyToDraw()); |
ManagedTileState& mts = tile->managed_state(); |
RasterMode used_mode = HIGH_QUALITY_NO_LCD_RASTER_MODE; |
- for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
+ for (int mode = 0; mode < RasterMode_ARRAYSIZE; ++mode) { |
if (mts.tile_versions[mode].IsReadyToDraw()) { |
used_mode = static_cast<RasterMode>(mode); |
break; |
} |
} |
- for (int mode = 0; mode < NUM_RASTER_MODES; ++mode) { |
+ for (int mode = 0; mode < RasterMode_ARRAYSIZE; ++mode) { |
if (mode != used_mode) |
FreeResourceForTile(tile, static_cast<RasterMode>(mode)); |
} |