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

Side by Side Diff: cc/resources/picture_layer_tiling.cc

Issue 669433002: cc: Invalidate eviction tiles cache when a tile is deleted. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
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/resources/picture_layer_tiling.h" 5 #include "cc/resources/picture_layer_tiling.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <set> 10 #include <set>
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 } 459 }
460 460
461 bool PictureLayerTiling::RemoveTileAt(int i, 461 bool PictureLayerTiling::RemoveTileAt(int i,
462 int j, 462 int j,
463 PictureLayerTiling* recycled_twin) { 463 PictureLayerTiling* recycled_twin) {
464 TileMap::iterator found = tiles_.find(TileMapKey(i, j)); 464 TileMap::iterator found = tiles_.find(TileMapKey(i, j));
465 if (found == tiles_.end()) 465 if (found == tiles_.end())
466 return false; 466 return false;
467 found->second->set_shared(false); 467 found->second->set_shared(false);
468 tiles_.erase(found); 468 tiles_.erase(found);
469 eviction_tiles_cache_valid_ = false;
469 if (recycled_twin) { 470 if (recycled_twin) {
470 // Recycled twin does not also have a recycled twin, so pass NULL. 471 // Recycled twin does not also have a recycled twin, so pass NULL.
471 recycled_twin->RemoveTileAt(i, j, NULL); 472 recycled_twin->RemoveTileAt(i, j, NULL);
472 } 473 }
473 return true; 474 return true;
474 } 475 }
475 476
476 void PictureLayerTiling::Reset() { 477 void PictureLayerTiling::Reset() {
477 live_tiles_rect_ = gfx::Rect(); 478 live_tiles_rect_ = gfx::Rect();
478 PictureLayerTiling* recycled_twin = client_->GetRecycledTwinTiling(this); 479 PictureLayerTiling* recycled_twin = client_->GetRecycledTwinTiling(this);
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
1222 DCHECK(*this); 1223 DCHECK(*this);
1223 do { 1224 do {
1224 ++current_eviction_tiles_index_; 1225 ++current_eviction_tiles_index_;
1225 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && 1226 } while (current_eviction_tiles_index_ != eviction_tiles_->size() &&
1226 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); 1227 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources());
1227 1228
1228 return *this; 1229 return *this;
1229 } 1230 }
1230 1231
1231 } // namespace cc 1232 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/picture_layer_tiling_unittest.cc » ('j') | cc/resources/picture_layer_tiling_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698