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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 82 } | 82 } |
| 83 | 83 |
| 84 TileManager::~TileManager() { | 84 TileManager::~TileManager() { |
| 85 // Reset global state and manage. This should cause | 85 // Reset global state and manage. This should cause |
| 86 // our memory usage to drop to zero. | 86 // our memory usage to drop to zero. |
| 87 global_state_ = GlobalStateThatImpactsTilePriority(); | 87 global_state_ = GlobalStateThatImpactsTilePriority(); |
| 88 AssignGpuMemoryToTiles(); | 88 AssignGpuMemoryToTiles(); |
| 89 // This should finish all pending tasks and release any uninitialized | 89 // This should finish all pending tasks and release any uninitialized |
| 90 // resources. | 90 // resources. |
| 91 raster_worker_pool_.reset(); | 91 raster_worker_pool_.reset(); |
| 92 ManageTiles(); | 92 CheckForCompletedSetPixels(); |
| 93 DCHECK(tiles_.size() == 0); | 93 DCHECK(tiles_.size() == 0); |
|
enne (OOO)
2013/01/15 03:36:25
Can you DCHECK(tiles_with_pending_set_pixels_.size
reveman
2013/01/15 04:05:13
Done.
| |
| 94 } | 94 } |
| 95 | 95 |
| 96 void TileManager::SetGlobalState( | 96 void TileManager::SetGlobalState( |
| 97 const GlobalStateThatImpactsTilePriority& global_state) { | 97 const GlobalStateThatImpactsTilePriority& global_state) { |
| 98 global_state_ = global_state; | 98 global_state_ = global_state; |
| 99 resource_pool_->SetMaxMemoryUsageBytes(global_state_.memory_limit_in_bytes); | 99 resource_pool_->SetMaxMemoryUsageBytes(global_state_.memory_limit_in_bytes); |
| 100 ScheduleManageTiles(); | 100 ScheduleManageTiles(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 void TileManager::RegisterTile(Tile* tile) { | 103 void TileManager::RegisterTile(Tile* tile) { |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 519 } | 519 } |
| 520 | 520 |
| 521 void TileManager::DidFinishTileInitialization(Tile* tile) { | 521 void TileManager::DidFinishTileInitialization(Tile* tile) { |
| 522 ManagedTileState& managed_tile_state = tile->managed_state(); | 522 ManagedTileState& managed_tile_state = tile->managed_state(); |
| 523 DCHECK(managed_tile_state.resource); | 523 DCHECK(managed_tile_state.resource); |
| 524 managed_tile_state.resource_is_being_initialized = false; | 524 managed_tile_state.resource_is_being_initialized = false; |
| 525 managed_tile_state.can_be_freed = true; | 525 managed_tile_state.can_be_freed = true; |
| 526 } | 526 } |
| 527 | 527 |
| 528 } // namespace cc | 528 } // namespace cc |
| OLD | NEW |