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 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 } | 852 } |
853 | 853 |
854 while (spiral_iterator_) { | 854 while (spiral_iterator_) { |
855 current_tile_ = tiling_->TileAt(spiral_iterator_.index_x(), | 855 current_tile_ = tiling_->TileAt(spiral_iterator_.index_x(), |
856 spiral_iterator_.index_y()); | 856 spiral_iterator_.index_y()); |
857 if (current_tile_ && TileNeedsRaster(current_tile_)) | 857 if (current_tile_ && TileNeedsRaster(current_tile_)) |
858 break; | 858 break; |
859 ++spiral_iterator_; | 859 ++spiral_iterator_; |
860 } | 860 } |
861 | 861 |
862 if (!spiral_iterator_ && type_ == TilePriority::EVENTUALLY) | 862 if (!spiral_iterator_ && type_ == TilePriority::EVENTUALLY) { |
| 863 current_tile_ = NULL; |
863 break; | 864 break; |
| 865 } |
864 } while (!spiral_iterator_); | 866 } while (!spiral_iterator_); |
865 } | 867 } |
866 | 868 |
867 PictureLayerTiling::TilingRasterTileIterator& | 869 PictureLayerTiling::TilingRasterTileIterator& |
868 PictureLayerTiling::TilingRasterTileIterator:: | 870 PictureLayerTiling::TilingRasterTileIterator:: |
869 operator++() { | 871 operator++() { |
870 current_tile_ = NULL; | 872 current_tile_ = NULL; |
871 while (!current_tile_ || !TileNeedsRaster(current_tile_)) { | 873 while (!current_tile_ || !TileNeedsRaster(current_tile_)) { |
872 std::pair<int, int> next_index; | 874 std::pair<int, int> next_index; |
873 switch (type_) { | 875 switch (type_) { |
(...skipping 20 matching lines...) Expand all Loading... |
894 visible_rect_in_content_space_); | 896 visible_rect_in_content_space_); |
895 if (!spiral_iterator_) { | 897 if (!spiral_iterator_) { |
896 AdvancePhase(); | 898 AdvancePhase(); |
897 return *this; | 899 return *this; |
898 } | 900 } |
899 } | 901 } |
900 next_index = spiral_iterator_.index(); | 902 next_index = spiral_iterator_.index(); |
901 break; | 903 break; |
902 case TilePriority::EVENTUALLY: | 904 case TilePriority::EVENTUALLY: |
903 ++spiral_iterator_; | 905 ++spiral_iterator_; |
904 if (!spiral_iterator_) | 906 if (!spiral_iterator_) { |
| 907 current_tile_ = NULL; |
905 return *this; | 908 return *this; |
| 909 } |
906 next_index = spiral_iterator_.index(); | 910 next_index = spiral_iterator_.index(); |
907 break; | 911 break; |
908 } | 912 } |
909 current_tile_ = tiling_->TileAt(next_index.first, next_index.second); | 913 current_tile_ = tiling_->TileAt(next_index.first, next_index.second); |
910 } | 914 } |
911 return *this; | 915 return *this; |
912 } | 916 } |
913 | 917 |
914 PictureLayerTiling::TilingEvictionTileIterator::TilingEvictionTileIterator() | 918 PictureLayerTiling::TilingEvictionTileIterator::TilingEvictionTileIterator() |
915 : is_valid_(false), tiling_(NULL) {} | 919 : is_valid_(false), tiling_(NULL) {} |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 tiling_->UpdateEvictionCacheIfNeeded(tree_priority_); | 959 tiling_->UpdateEvictionCacheIfNeeded(tree_priority_); |
956 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); | 960 tile_iterator_ = tiling_->eviction_tiles_cache_.begin(); |
957 is_valid_ = true; | 961 is_valid_ = true; |
958 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && | 962 if (tile_iterator_ != tiling_->eviction_tiles_cache_.end() && |
959 !(*tile_iterator_)->HasResources()) { | 963 !(*tile_iterator_)->HasResources()) { |
960 ++(*this); | 964 ++(*this); |
961 } | 965 } |
962 } | 966 } |
963 | 967 |
964 } // namespace cc | 968 } // namespace cc |
OLD | NEW |