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

Side by Side Diff: cc/tile_manager.cc

Issue 11637022: Send memory management policies to the tile manager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/managed_memory_policy.h ('K') | « cc/resource_pool.cc ('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/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
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
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 }
OLDNEW
« cc/managed_memory_policy.h ('K') | « cc/resource_pool.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698