Chromium Code Reviews| 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/tile_manager.h" | 5 #include "cc/tile_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 184 AssignGpuMemoryToTiles(); | 184 AssignGpuMemoryToTiles(); |
| 185 // This should finish all pending raster tasks and release any | 185 // This should finish all pending raster tasks and release any |
| 186 // uninitialized resources. | 186 // uninitialized resources. |
| 187 raster_threads_.clear(); | 187 raster_threads_.clear(); |
| 188 ManageTiles(); | 188 ManageTiles(); |
| 189 DCHECK(tiles_.size() == 0); | 189 DCHECK(tiles_.size() == 0); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void TileManager::SetGlobalState(const GlobalStateThatImpactsTilePriority& globa l_state) { | 192 void TileManager::SetGlobalState(const GlobalStateThatImpactsTilePriority& globa l_state) { |
| 193 global_state_ = global_state; | 193 global_state_ = global_state; |
| 194 resource_pool_->SetMaxMemoryUsageBytes(global_state_.memory_limit_in_bytes); | |
|
nduca
2012/12/19 21:46:32
why remove this? :)
| |
| 195 ScheduleManageTiles(); | 194 ScheduleManageTiles(); |
| 196 } | 195 } |
| 197 | 196 |
| 198 void TileManager::RegisterTile(Tile* tile) { | 197 void TileManager::RegisterTile(Tile* tile) { |
| 199 tiles_.push_back(tile); | 198 tiles_.push_back(tile); |
| 200 ScheduleManageTiles(); | 199 ScheduleManageTiles(); |
| 201 } | 200 } |
| 202 | 201 |
| 203 void TileManager::UnregisterTile(Tile* tile) { | 202 void TileManager::UnregisterTile(Tile* tile) { |
| 204 for (TileList::iterator it = tiles_with_image_decoding_tasks_.begin(); | 203 for (TileList::iterator it = tiles_with_image_decoding_tasks_.begin(); |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 685 void TileManager::DidFinishTileInitialization(Tile* tile) { | 684 void TileManager::DidFinishTileInitialization(Tile* tile) { |
| 686 ManagedTileState& managed_tile_state = tile->managed_state(); | 685 ManagedTileState& managed_tile_state = tile->managed_state(); |
| 687 DCHECK(managed_tile_state.resource); | 686 DCHECK(managed_tile_state.resource); |
| 688 managed_tile_state.resource_is_being_initialized = false; | 687 managed_tile_state.resource_is_being_initialized = false; |
| 689 managed_tile_state.can_be_freed = true; | 688 managed_tile_state.can_be_freed = true; |
| 690 for (int i = 0; i < NUM_TREES; ++i) | 689 for (int i = 0; i < NUM_TREES; ++i) |
| 691 drawable_tiles_in_bin_count_[managed_tile_state.bin[i]][i]++; | 690 drawable_tiles_in_bin_count_[managed_tile_state.bin[i]][i]++; |
| 692 } | 691 } |
| 693 | 692 |
| 694 } | 693 } |
| OLD | NEW |