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

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

Issue 842523002: base: Change DCHECK_IS_ON to a macro DCHECK_IS_ON(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dcheck2: withoutandroidchange 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
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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
1159 } 1159 }
1160 current_tile_ = tiling_->TileAt(next_index.first, next_index.second); 1160 current_tile_ = tiling_->TileAt(next_index.first, next_index.second);
1161 } 1161 }
1162 1162
1163 if (current_tile_) 1163 if (current_tile_)
1164 tiling_->UpdateTileAndTwinPriority(current_tile_); 1164 tiling_->UpdateTileAndTwinPriority(current_tile_);
1165 return *this; 1165 return *this;
1166 } 1166 }
1167 1167
1168 } // namespace cc 1168 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698