Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(630)

Side by Side Diff: cc/resources/picture_layer_tiling.cc

Issue 851503003: Update from https://crrev.com/311076 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/resources/picture.cc ('k') | cc/resources/picture_layer_tiling_set.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_ON()
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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 676
677 live_tiles_rect_ = new_live_tiles_rect; 677 live_tiles_rect_ = new_live_tiles_rect;
678 VerifyLiveTilesRect(false); 678 VerifyLiveTilesRect(false);
679 if (recycled_twin) { 679 if (recycled_twin) {
680 recycled_twin->live_tiles_rect_ = live_tiles_rect_; 680 recycled_twin->live_tiles_rect_ = live_tiles_rect_;
681 recycled_twin->VerifyLiveTilesRect(true); 681 recycled_twin->VerifyLiveTilesRect(true);
682 } 682 }
683 } 683 }
684 684
685 void PictureLayerTiling::VerifyLiveTilesRect(bool is_on_recycle_tree) const { 685 void PictureLayerTiling::VerifyLiveTilesRect(bool is_on_recycle_tree) const {
686 #if DCHECK_IS_ON 686 #if DCHECK_IS_ON()
687 for (auto it = tiles_.begin(); it != tiles_.end(); ++it) { 687 for (auto it = tiles_.begin(); it != tiles_.end(); ++it) {
688 if (!it->second.get()) 688 if (!it->second.get())
689 continue; 689 continue;
690 DCHECK(it->first.first < tiling_data_.num_tiles_x()) 690 DCHECK(it->first.first < tiling_data_.num_tiles_x())
691 << this << " " << it->first.first << "," << it->first.second 691 << this << " " << it->first.first << "," << it->first.second
692 << " num_tiles_x " << tiling_data_.num_tiles_x() << " live_tiles_rect " 692 << " num_tiles_x " << tiling_data_.num_tiles_x() << " live_tiles_rect "
693 << live_tiles_rect_.ToString(); 693 << live_tiles_rect_.ToString();
694 DCHECK(it->first.second < tiling_data_.num_tiles_y()) 694 DCHECK(it->first.second < tiling_data_.num_tiles_y())
695 << this << " " << it->first.first << "," << it->first.second 695 << this << " " << it->first.first << "," << it->first.second
696 << " num_tiles_y " << tiling_data_.num_tiles_y() << " live_tiles_rect " 696 << " num_tiles_y " << tiling_data_.num_tiles_y() << " live_tiles_rect "
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1028 break; 1028 break;
1029 } 1029 }
1030 1030
1031 gfx::Rect result(origin_x, origin_y, width, height); 1031 gfx::Rect result(origin_x, origin_y, width, height);
1032 if (cache) 1032 if (cache)
1033 cache->previous_result = result; 1033 cache->previous_result = result;
1034 return result; 1034 return result;
1035 } 1035 }
1036 1036
1037 } // namespace cc 1037 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/picture.cc ('k') | cc/resources/picture_layer_tiling_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698