Chromium Code Reviews| 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_set.h" | 5 #include "cc/resources/picture_layer_tiling_set.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 } | 116 } |
| 117 | 117 |
| 118 if (!tilings_.empty()) { | 118 if (!tilings_.empty()) { |
| 119 size_t num_high_res = std::count_if(tilings_.begin(), tilings_.end(), | 119 size_t num_high_res = std::count_if(tilings_.begin(), tilings_.end(), |
| 120 [](PictureLayerTiling* tiling) { | 120 [](PictureLayerTiling* tiling) { |
| 121 return tiling->resolution() == HIGH_RESOLUTION; | 121 return tiling->resolution() == HIGH_RESOLUTION; |
| 122 }); | 122 }); |
| 123 DCHECK_LE(num_high_res, 1u); | 123 DCHECK_LE(num_high_res, 1u); |
| 124 // When commiting from the main thread the high res tiling may get dropped, | 124 // When commiting from the main thread the high res tiling may get dropped, |
| 125 // but when cloning to the active tree, there should always be one. | 125 // but when cloning to the active tree, there should always be one. |
| 126 if (twin_set) | 126 if (twin_set) |
|
vmpstr
2015/02/05 18:26:33
nit: wrap in braces please
danakj
2015/02/05 18:32:03
Done.
| |
| 127 DCHECK_EQ(1u, num_high_res); | 127 DCHECK_EQ(1u, num_high_res) |
| 128 << " num tilings on active: " << tilings_.size() | |
|
vmpstr
2015/02/05 18:26:33
Maybe also tilings_->NumHighResTilings() for both
danakj
2015/02/05 18:32:03
Done.
| |
| 129 << " num tilings on pending: " << twin_set->tilings_.size() | |
| 130 << " are on active tree: " << (client_->GetTree() == ACTIVE_TREE); | |
| 128 } | 131 } |
| 129 #endif | 132 #endif |
| 130 } | 133 } |
| 131 | 134 |
| 132 void PictureLayerTilingSet::CleanUpTilings( | 135 void PictureLayerTilingSet::CleanUpTilings( |
| 133 float min_acceptable_high_res_scale, | 136 float min_acceptable_high_res_scale, |
| 134 float max_acceptable_high_res_scale, | 137 float max_acceptable_high_res_scale, |
| 135 const std::vector<PictureLayerTiling*>& needed_tilings, | 138 const std::vector<PictureLayerTiling*>& needed_tilings, |
| 136 bool should_have_low_res, | 139 bool should_have_low_res, |
| 137 PictureLayerTilingSet* twin_set, | 140 PictureLayerTilingSet* twin_set, |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 536 case LOWER_THAN_LOW_RES: | 539 case LOWER_THAN_LOW_RES: |
| 537 range = TilingRange(low_res_range.end, tilings_.size()); | 540 range = TilingRange(low_res_range.end, tilings_.size()); |
| 538 break; | 541 break; |
| 539 } | 542 } |
| 540 | 543 |
| 541 DCHECK_LE(range.start, range.end); | 544 DCHECK_LE(range.start, range.end); |
| 542 return range; | 545 return range; |
| 543 } | 546 } |
| 544 | 547 |
| 545 } // namespace cc | 548 } // namespace cc |
| OLD | NEW |