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

Side by Side Diff: cc/tile_manager.cc

Issue 11549038: cc: Fix tile deletion. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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
« no previous file with comments | « no previous file | 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 resource_pool_->SetMaxMemoryUsageBytes(global_state_.memory_limit_in_bytes); 163 resource_pool_->SetMaxMemoryUsageBytes(global_state_.memory_limit_in_bytes);
164 ScheduleManageTiles(); 164 ScheduleManageTiles();
165 } 165 }
166 166
167 void TileManager::RegisterTile(Tile* tile) { 167 void TileManager::RegisterTile(Tile* tile) {
168 tiles_.push_back(tile); 168 tiles_.push_back(tile);
169 ScheduleManageTiles(); 169 ScheduleManageTiles();
170 } 170 }
171 171
172 void TileManager::UnregisterTile(Tile* tile) { 172 void TileManager::UnregisterTile(Tile* tile) {
173 for (TileList::iterator it = tiles_with_image_decoding_tasks_.begin();
174 it != tiles_with_image_decoding_tasks_.end(); it++) {
175 if (*it == tile) {
176 tiles_with_image_decoding_tasks_.erase(it);
177 break;;
178 }
179 }
180 for (TileVector::iterator it = tiles_that_need_to_be_rasterized_.begin();
181 it != tiles_that_need_to_be_rasterized_.end(); it++) {
182 if (*it == tile) {
183 tiles_that_need_to_be_rasterized_.erase(it);
184 break;
185 }
186 }
173 for (TileVector::iterator it = tiles_.begin(); it != tiles_.end(); it++) { 187 for (TileVector::iterator it = tiles_.begin(); it != tiles_.end(); it++) {
174 if (*it == tile) { 188 if (*it == tile) {
175 FreeResourcesForTile(tile); 189 FreeResourcesForTile(tile);
176 tiles_.erase(it); 190 tiles_.erase(it);
177 return; 191 return;
178 } 192 }
179 } 193 }
180 DCHECK(false) << "Could not find tile version."; 194 DCHECK(false) << "Could not find tile version.";
181 } 195 }
182 196
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 } 615 }
602 616
603 void TileManager::DidFinishTileInitialization(Tile* tile) { 617 void TileManager::DidFinishTileInitialization(Tile* tile) {
604 ManagedTileState& managed_tile_state = tile->managed_state(); 618 ManagedTileState& managed_tile_state = tile->managed_state();
605 DCHECK(managed_tile_state.resource); 619 DCHECK(managed_tile_state.resource);
606 managed_tile_state.resource_is_being_initialized = false; 620 managed_tile_state.resource_is_being_initialized = false;
607 managed_tile_state.can_be_freed = true; 621 managed_tile_state.can_be_freed = true;
608 } 622 }
609 623
610 } 624 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698