| 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/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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 | 241 |
| 242 if (tile_size != tiling_data_.max_texture_size()) { | 242 if (tile_size != tiling_data_.max_texture_size()) { |
| 243 tiling_data_.SetMaxTextureSize(tile_size); | 243 tiling_data_.SetMaxTextureSize(tile_size); |
| 244 // When the tile size changes, the TilingData positions no longer work | 244 // When the tile size changes, the TilingData positions no longer work |
| 245 // as valid keys to the TileMap, so just drop all tiles. | 245 // as valid keys to the TileMap, so just drop all tiles. |
| 246 Reset(); | 246 Reset(); |
| 247 } else { | 247 } else { |
| 248 Invalidate(layer_invalidation); | 248 Invalidate(layer_invalidation); |
| 249 } | 249 } |
| 250 | 250 |
| 251 PicturePileImpl* pile = client_->GetPile(); | 251 RasterSource* raster_source = client_->GetRasterSource(); |
| 252 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) | 252 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) |
| 253 it->second->set_picture_pile(pile); | 253 it->second->set_raster_source(raster_source); |
| 254 VerifyLiveTilesRect(); | 254 VerifyLiveTilesRect(); |
| 255 } | 255 } |
| 256 | 256 |
| 257 void PictureLayerTiling::RemoveTilesInRegion(const Region& layer_region) { | 257 void PictureLayerTiling::RemoveTilesInRegion(const Region& layer_region) { |
| 258 bool recreate_invalidated_tiles = false; | 258 bool recreate_invalidated_tiles = false; |
| 259 DoInvalidate(layer_region, recreate_invalidated_tiles); | 259 DoInvalidate(layer_region, recreate_invalidated_tiles); |
| 260 } | 260 } |
| 261 | 261 |
| 262 void PictureLayerTiling::Invalidate(const Region& layer_region) { | 262 void PictureLayerTiling::Invalidate(const Region& layer_region) { |
| 263 bool recreate_invalidated_tiles = true; | 263 bool recreate_invalidated_tiles = true; |
| (...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1227 DCHECK(*this); | 1227 DCHECK(*this); |
| 1228 do { | 1228 do { |
| 1229 ++current_eviction_tiles_index_; | 1229 ++current_eviction_tiles_index_; |
| 1230 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && | 1230 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && |
| 1231 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); | 1231 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); |
| 1232 | 1232 |
| 1233 return *this; | 1233 return *this; |
| 1234 } | 1234 } |
| 1235 | 1235 |
| 1236 } // namespace cc | 1236 } // namespace cc |
| OLD | NEW |