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

Unified Diff: cc/resources/picture_layer_tiling_set.cc

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/picture_layer_tiling_set.h ('k') | cc/resources/picture_pile.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/picture_layer_tiling_set.cc
diff --git a/cc/resources/picture_layer_tiling_set.cc b/cc/resources/picture_layer_tiling_set.cc
index 779e2c08e9e6d994b9f4f7e9c25635c42efc8662..7c36a3ff552e40ccf701abdb466e489560500562 100644
--- a/cc/resources/picture_layer_tiling_set.cc
+++ b/cc/resources/picture_layer_tiling_set.cc
@@ -116,15 +116,16 @@ void PictureLayerTilingSet::UpdateTilingsToCurrentRasterSource(
}
if (!tilings_.empty()) {
- size_t num_high_res = std::count_if(tilings_.begin(), tilings_.end(),
- [](PictureLayerTiling* tiling) {
- return tiling->resolution() == HIGH_RESOLUTION;
- });
- DCHECK_LE(num_high_res, 1u);
+ DCHECK_LE(NumHighResTilings(), 1);
// When commiting from the main thread the high res tiling may get dropped,
// but when cloning to the active tree, there should always be one.
- if (twin_set)
- DCHECK_EQ(1u, num_high_res);
+ if (twin_set) {
+ DCHECK_EQ(1, NumHighResTilings())
+ << " num tilings on active: " << tilings_.size()
+ << " num tilings on pending: " << twin_set->tilings_.size()
+ << " num high res on pending: " << twin_set->NumHighResTilings()
+ << " are on active tree: " << (client_->GetTree() == ACTIVE_TREE);
+ }
}
#endif
}
@@ -214,12 +215,10 @@ PictureLayerTiling* PictureLayerTilingSet::AddTiling(
}
int PictureLayerTilingSet::NumHighResTilings() const {
- int num_high_res = 0;
- for (size_t i = 0; i < tilings_.size(); ++i) {
- if (tilings_[i]->resolution() == HIGH_RESOLUTION)
- num_high_res++;
- }
- return num_high_res;
+ return std::count_if(tilings_.begin(), tilings_.end(),
+ [](PictureLayerTiling* tiling) {
+ return tiling->resolution() == HIGH_RESOLUTION;
+ });
}
PictureLayerTiling* PictureLayerTilingSet::FindTilingWithScale(
« no previous file with comments | « cc/resources/picture_layer_tiling_set.h ('k') | cc/resources/picture_pile.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698