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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 | 188 |
189 // Create any missing tiles from the |twin_tiling|. | 189 // Create any missing tiles from the |twin_tiling|. |
190 for (const auto& tile_map_pair : twin_tiling.tiles_) { | 190 for (const auto& tile_map_pair : twin_tiling.tiles_) { |
191 TileMapKey key = tile_map_pair.first; | 191 TileMapKey key = tile_map_pair.first; |
192 Tile* tile = tile_map_pair.second.get(); | 192 Tile* tile = tile_map_pair.second.get(); |
193 if (!tile->is_shared()) | 193 if (!tile->is_shared()) |
194 CreateTile(key.first, key.second, &twin_tiling, null_recycled_twin); | 194 CreateTile(key.first, key.second, &twin_tiling, null_recycled_twin); |
195 } | 195 } |
196 | 196 |
197 DCHECK_EQ(twin_tiling.tiles_.size(), tiles_.size()); | 197 DCHECK_EQ(twin_tiling.tiles_.size(), tiles_.size()); |
198 #if DCHECK_IS_ON | 198 #if !DCHECK_IS_OFF |
199 for (const auto& tile_map_pair : tiles_) | 199 for (const auto& tile_map_pair : tiles_) |
200 DCHECK(tile_map_pair.second->is_shared()); | 200 DCHECK(tile_map_pair.second->is_shared()); |
201 VerifyLiveTilesRect(false); | 201 VerifyLiveTilesRect(false); |
202 #endif | 202 #endif |
203 | 203 |
204 UpdateTilePriorityRects(twin_tiling.current_content_to_screen_scale_, | 204 UpdateTilePriorityRects(twin_tiling.current_content_to_screen_scale_, |
205 twin_tiling.current_visible_rect_, | 205 twin_tiling.current_visible_rect_, |
206 twin_tiling.current_skewport_rect_, | 206 twin_tiling.current_skewport_rect_, |
207 twin_tiling.current_soon_border_rect_, | 207 twin_tiling.current_soon_border_rect_, |
208 twin_tiling.current_eventually_rect_, | 208 twin_tiling.current_eventually_rect_, |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 | 687 |
688 live_tiles_rect_ = new_live_tiles_rect; | 688 live_tiles_rect_ = new_live_tiles_rect; |
689 VerifyLiveTilesRect(false); | 689 VerifyLiveTilesRect(false); |
690 if (recycled_twin) { | 690 if (recycled_twin) { |
691 recycled_twin->live_tiles_rect_ = live_tiles_rect_; | 691 recycled_twin->live_tiles_rect_ = live_tiles_rect_; |
692 recycled_twin->VerifyLiveTilesRect(true); | 692 recycled_twin->VerifyLiveTilesRect(true); |
693 } | 693 } |
694 } | 694 } |
695 | 695 |
696 void PictureLayerTiling::VerifyLiveTilesRect(bool is_on_recycle_tree) const { | 696 void PictureLayerTiling::VerifyLiveTilesRect(bool is_on_recycle_tree) const { |
697 #if DCHECK_IS_ON | 697 #if !DCHECK_IS_OFF |
698 for (auto it = tiles_.begin(); it != tiles_.end(); ++it) { | 698 for (auto it = tiles_.begin(); it != tiles_.end(); ++it) { |
699 if (!it->second.get()) | 699 if (!it->second.get()) |
700 continue; | 700 continue; |
701 DCHECK(it->first.first < tiling_data_.num_tiles_x()) | 701 DCHECK(it->first.first < tiling_data_.num_tiles_x()) |
702 << this << " " << it->first.first << "," << it->first.second | 702 << this << " " << it->first.first << "," << it->first.second |
703 << " num_tiles_x " << tiling_data_.num_tiles_x() << " live_tiles_rect " | 703 << " num_tiles_x " << tiling_data_.num_tiles_x() << " live_tiles_rect " |
704 << live_tiles_rect_.ToString(); | 704 << live_tiles_rect_.ToString(); |
705 DCHECK(it->first.second < tiling_data_.num_tiles_y()) | 705 DCHECK(it->first.second < tiling_data_.num_tiles_y()) |
706 << this << " " << it->first.first << "," << it->first.second | 706 << this << " " << it->first.first << "," << it->first.second |
707 << " num_tiles_y " << tiling_data_.num_tiles_y() << " live_tiles_rect " | 707 << " num_tiles_y " << tiling_data_.num_tiles_y() << " live_tiles_rect " |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 } | 1170 } |
1171 current_tile_ = tiling_->TileAt(next_index.first, next_index.second); | 1171 current_tile_ = tiling_->TileAt(next_index.first, next_index.second); |
1172 } | 1172 } |
1173 | 1173 |
1174 if (current_tile_) | 1174 if (current_tile_) |
1175 tiling_->UpdateTileAndTwinPriority(current_tile_); | 1175 tiling_->UpdateTileAndTwinPriority(current_tile_); |
1176 return *this; | 1176 return *this; |
1177 } | 1177 } |
1178 | 1178 |
1179 } // namespace cc | 1179 } // namespace cc |
OLD | NEW |