| 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 | 10 |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 831 } | 831 } |
| 832 | 832 |
| 833 current_tile_ = | 833 current_tile_ = |
| 834 tiling_->TileAt(visible_iterator_.index_x(), visible_iterator_.index_y()); | 834 tiling_->TileAt(visible_iterator_.index_x(), visible_iterator_.index_y()); |
| 835 if (!current_tile_ || !TileNeedsRaster(current_tile_)) | 835 if (!current_tile_ || !TileNeedsRaster(current_tile_)) |
| 836 ++(*this); | 836 ++(*this); |
| 837 } | 837 } |
| 838 | 838 |
| 839 PictureLayerTiling::TilingRasterTileIterator::~TilingRasterTileIterator() {} | 839 PictureLayerTiling::TilingRasterTileIterator::~TilingRasterTileIterator() {} |
| 840 | 840 |
| 841 bool |
| 842 PictureLayerTiling::TilingRasterTileIterator::HasTilesRequiredForActivation() |
| 843 const { |
| 844 if (!*this || get_type() != TilePriority::NOW) |
| 845 return false; |
| 846 |
| 847 for (TilingData::Iterator it = visible_iterator_; it; ++it) { |
| 848 std::pair<int, int> next_index = visible_iterator_.index(); |
| 849 Tile* tile = tiling_->TileAt(next_index.first, next_index.second); |
| 850 if (tile && tile->required_for_activation()) |
| 851 return true; |
| 852 } |
| 853 return false; |
| 854 } |
| 855 |
| 841 void PictureLayerTiling::TilingRasterTileIterator::AdvancePhase() { | 856 void PictureLayerTiling::TilingRasterTileIterator::AdvancePhase() { |
| 842 DCHECK_LT(type_, TilePriority::EVENTUALLY); | 857 DCHECK_LT(type_, TilePriority::EVENTUALLY); |
| 843 | 858 |
| 844 do { | 859 do { |
| 845 type_ = static_cast<TilePriority::PriorityBin>(type_ + 1); | 860 type_ = static_cast<TilePriority::PriorityBin>(type_ + 1); |
| 846 if (type_ == TilePriority::EVENTUALLY) { | 861 if (type_ == TilePriority::EVENTUALLY) { |
| 847 spiral_iterator_ = TilingData::SpiralDifferenceIterator( | 862 spiral_iterator_ = TilingData::SpiralDifferenceIterator( |
| 848 &tiling_->tiling_data_, | 863 &tiling_->tiling_data_, |
| 849 eventually_rect_in_content_space_, | 864 eventually_rect_in_content_space_, |
| 850 skewport_in_content_space_, | 865 skewport_in_content_space_, |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 tiling_->UpdateEvictionCacheIfNeeded(tree_priority_); | 970 tiling_->UpdateEvictionCacheIfNeeded(tree_priority_); |
| 956 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); | 971 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); |
| 957 is_valid_ = true; | 972 is_valid_ = true; |
| 958 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && | 973 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && |
| 959 !(*tile_iterator_)->HasResources()) { | 974 !(*tile_iterator_)->HasResources()) { |
| 960 ++(*this); | 975 ++(*this); |
| 961 } | 976 } |
| 962 } | 977 } |
| 963 | 978 |
| 964 } // namespace cc | 979 } // namespace cc |
| OLD | NEW |