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