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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 // Create a new tile because our twin didn't have a valid one. | 141 // Create a new tile because our twin didn't have a valid one. |
142 scoped_refptr<Tile> tile = client_->CreateTile(this, tile_rect); | 142 scoped_refptr<Tile> tile = client_->CreateTile(this, tile_rect); |
143 if (tile.get()) { | 143 if (tile.get()) { |
144 DCHECK(!tile->is_shared()); | 144 DCHECK(!tile->is_shared()); |
145 tile->set_tiling_index(i, j); | 145 tile->set_tiling_index(i, j); |
146 tiles_[key] = tile; | 146 tiles_[key] = tile; |
147 } | 147 } |
| 148 eviction_tiles_cache_valid_ = false; |
148 return tile.get(); | 149 return tile.get(); |
149 } | 150 } |
150 | 151 |
151 void PictureLayerTiling::CreateMissingTilesInLiveTilesRect() { | 152 void PictureLayerTiling::CreateMissingTilesInLiveTilesRect() { |
152 const PictureLayerTiling* twin_tiling = | 153 const PictureLayerTiling* twin_tiling = |
153 client_->GetPendingOrActiveTwinTiling(this); | 154 client_->GetPendingOrActiveTwinTiling(this); |
154 bool include_borders = false; | 155 bool include_borders = false; |
155 for (TilingData::Iterator iter( | 156 for (TilingData::Iterator iter( |
156 &tiling_data_, live_tiles_rect_, include_borders); | 157 &tiling_data_, live_tiles_rect_, include_borders); |
157 iter; | 158 iter; |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 | 480 |
480 void PictureLayerTiling::Reset() { | 481 void PictureLayerTiling::Reset() { |
481 live_tiles_rect_ = gfx::Rect(); | 482 live_tiles_rect_ = gfx::Rect(); |
482 PictureLayerTiling* recycled_twin = client_->GetRecycledTwinTiling(this); | 483 PictureLayerTiling* recycled_twin = client_->GetRecycledTwinTiling(this); |
483 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { | 484 for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) { |
484 it->second->set_shared(false); | 485 it->second->set_shared(false); |
485 if (recycled_twin) | 486 if (recycled_twin) |
486 recycled_twin->RemoveTileAt(it->first.first, it->first.second, NULL); | 487 recycled_twin->RemoveTileAt(it->first.first, it->first.second, NULL); |
487 } | 488 } |
488 tiles_.clear(); | 489 tiles_.clear(); |
| 490 eviction_tiles_cache_valid_ = false; |
489 } | 491 } |
490 | 492 |
491 gfx::Rect PictureLayerTiling::ComputeSkewport( | 493 gfx::Rect PictureLayerTiling::ComputeSkewport( |
492 double current_frame_time_in_seconds, | 494 double current_frame_time_in_seconds, |
493 const gfx::Rect& visible_rect_in_content_space) const { | 495 const gfx::Rect& visible_rect_in_content_space) const { |
494 gfx::Rect skewport = visible_rect_in_content_space; | 496 gfx::Rect skewport = visible_rect_in_content_space; |
495 if (last_impl_frame_time_in_seconds_ == 0.0) | 497 if (last_impl_frame_time_in_seconds_ == 0.0) |
496 return skewport; | 498 return skewport; |
497 | 499 |
498 double time_delta = | 500 double time_delta = |
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1232 DCHECK(*this); | 1234 DCHECK(*this); |
1233 do { | 1235 do { |
1234 ++current_eviction_tiles_index_; | 1236 ++current_eviction_tiles_index_; |
1235 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && | 1237 } while (current_eviction_tiles_index_ != eviction_tiles_->size() && |
1236 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); | 1238 !(*eviction_tiles_)[current_eviction_tiles_index_]->HasResources()); |
1237 | 1239 |
1238 return *this; | 1240 return *this; |
1239 } | 1241 } |
1240 | 1242 |
1241 } // namespace cc | 1243 } // namespace cc |
OLD | NEW |