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 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 } | 845 } |
846 | 846 |
847 // Non-NOW bin tiles are not required or occluded. | 847 // Non-NOW bin tiles are not required or occluded. |
848 if (tree == PENDING_TREE) | 848 if (tree == PENDING_TREE) |
849 tile->set_required_for_activation(false); | 849 tile->set_required_for_activation(false); |
850 else | 850 else |
851 tile->set_required_for_draw(false); | 851 tile->set_required_for_draw(false); |
852 tile->set_is_occluded(tree, false); | 852 tile->set_is_occluded(tree, false); |
853 } | 853 } |
854 | 854 |
| 855 void PictureLayerTiling::VerifyAllTilesHaveCurrentRasterSource() const { |
| 856 #if DCHECK_IS_ON() |
| 857 for (const auto& tile_pair : tiles_) |
| 858 DCHECK_EQ(raster_source_.get(), tile_pair.second->raster_source()); |
| 859 #endif |
| 860 } |
| 861 |
855 TilePriority PictureLayerTiling::ComputePriorityForTile( | 862 TilePriority PictureLayerTiling::ComputePriorityForTile( |
856 const Tile* tile) const { | 863 const Tile* tile) const { |
857 // TODO(vmpstr): See if this can be moved to iterators. | 864 // TODO(vmpstr): See if this can be moved to iterators. |
858 TilePriority::PriorityBin max_tile_priority_bin = | 865 TilePriority::PriorityBin max_tile_priority_bin = |
859 client_->GetMaxTilePriorityBin(); | 866 client_->GetMaxTilePriorityBin(); |
860 | 867 |
861 DCHECK_EQ(TileAt(tile->tiling_i_index(), tile->tiling_j_index()), tile); | 868 DCHECK_EQ(TileAt(tile->tiling_i_index(), tile->tiling_j_index()), tile); |
862 gfx::Rect tile_bounds = | 869 gfx::Rect tile_bounds = |
863 tiling_data_.TileBounds(tile->tiling_i_index(), tile->tiling_j_index()); | 870 tiling_data_.TileBounds(tile->tiling_i_index(), tile->tiling_j_index()); |
864 | 871 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1064 break; | 1071 break; |
1065 } | 1072 } |
1066 | 1073 |
1067 gfx::Rect result(origin_x, origin_y, width, height); | 1074 gfx::Rect result(origin_x, origin_y, width, height); |
1068 if (cache) | 1075 if (cache) |
1069 cache->previous_result = result; | 1076 cache->previous_result = result; |
1070 return result; | 1077 return result; |
1071 } | 1078 } |
1072 | 1079 |
1073 } // namespace cc | 1080 } // namespace cc |
OLD | NEW |