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/tiles/picture_layer_tiling_set.h" | 5 #include "cc/tiles/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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 void PictureLayerTilingSet::UpdateTilingsToCurrentRasterSourceForCommit( | 133 void PictureLayerTilingSet::UpdateTilingsToCurrentRasterSourceForCommit( |
134 scoped_refptr<DisplayListRasterSource> raster_source, | 134 scoped_refptr<DisplayListRasterSource> raster_source, |
135 const Region& layer_invalidation, | 135 const Region& layer_invalidation, |
136 float minimum_contents_scale, | 136 float minimum_contents_scale, |
137 float maximum_contents_scale) { | 137 float maximum_contents_scale) { |
138 RemoveTilingsBelowScale(minimum_contents_scale); | 138 RemoveTilingsBelowScale(minimum_contents_scale); |
139 RemoveTilingsAboveScale(maximum_contents_scale); | 139 RemoveTilingsAboveScale(maximum_contents_scale); |
140 | 140 |
141 // Invalidate tiles and update them to the new raster source. | 141 // Invalidate tiles and update them to the new raster source. |
142 for (PictureLayerTiling* tiling : tilings_) { | 142 for (PictureLayerTiling* tiling : tilings_) { |
143 DCHECK_IMPLIES(tree_ == PENDING_TREE, !tiling->has_tiles()); | 143 DCHECK(tree_ != PENDING_TREE || !tiling->has_tiles()); |
144 tiling->SetRasterSourceAndResize(raster_source); | 144 tiling->SetRasterSourceAndResize(raster_source); |
145 | 145 |
146 // We can commit on either active or pending trees, but only active one can | 146 // We can commit on either active or pending trees, but only active one can |
147 // have tiles at this point. | 147 // have tiles at this point. |
148 if (tree_ == ACTIVE_TREE) | 148 if (tree_ == ACTIVE_TREE) |
149 tiling->Invalidate(layer_invalidation); | 149 tiling->Invalidate(layer_invalidation); |
150 | 150 |
151 // This is needed for cases where the live tiles rect didn't change but | 151 // This is needed for cases where the live tiles rect didn't change but |
152 // recordings exist in the raster source that did not exist on the last | 152 // recordings exist in the raster source that did not exist on the last |
153 // raster source. | 153 // raster source. |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 case LOWER_THAN_LOW_RES: | 575 case LOWER_THAN_LOW_RES: |
576 range = TilingRange(low_res_range.end, tilings_size); | 576 range = TilingRange(low_res_range.end, tilings_size); |
577 break; | 577 break; |
578 } | 578 } |
579 | 579 |
580 DCHECK_LE(range.start, range.end); | 580 DCHECK_LE(range.start, range.end); |
581 return range; | 581 return range; |
582 } | 582 } |
583 | 583 |
584 } // namespace cc | 584 } // namespace cc |
OLD | NEW |