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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 void PictureLayerTilingSet::UpdateTilingsToCurrentRasterSourceForCommit( | 130 void PictureLayerTilingSet::UpdateTilingsToCurrentRasterSourceForCommit( |
131 scoped_refptr<RasterSource> raster_source, | 131 scoped_refptr<RasterSource> raster_source, |
132 const Region& layer_invalidation, | 132 const Region& layer_invalidation, |
133 float minimum_contents_scale, | 133 float minimum_contents_scale, |
134 float maximum_contents_scale) { | 134 float maximum_contents_scale) { |
135 RemoveTilingsBelowScale(minimum_contents_scale); | 135 RemoveTilingsBelowScale(minimum_contents_scale); |
136 RemoveTilingsAboveScale(maximum_contents_scale); | 136 RemoveTilingsAboveScale(maximum_contents_scale); |
137 | 137 |
138 // Invalidate tiles and update them to the new raster source. | 138 // Invalidate tiles and update them to the new raster source. |
139 for (PictureLayerTiling* tiling : tilings_) { | 139 for (PictureLayerTiling* tiling : tilings_) { |
140 DCHECK_IMPLIES(tree_ == PENDING_TREE, !tiling->has_tiles()); | 140 DCHECK(tree_ != PENDING_TREE || !tiling->has_tiles()); |
141 tiling->SetRasterSourceAndResize(raster_source); | 141 tiling->SetRasterSourceAndResize(raster_source); |
142 | 142 |
143 // We can commit on either active or pending trees, but only active one can | 143 // We can commit on either active or pending trees, but only active one can |
144 // have tiles at this point. | 144 // have tiles at this point. |
145 if (tree_ == ACTIVE_TREE) | 145 if (tree_ == ACTIVE_TREE) |
146 tiling->Invalidate(layer_invalidation); | 146 tiling->Invalidate(layer_invalidation); |
147 | 147 |
148 // This is needed for cases where the live tiles rect didn't change but | 148 // This is needed for cases where the live tiles rect didn't change but |
149 // recordings exist in the raster source that did not exist on the last | 149 // recordings exist in the raster source that did not exist on the last |
150 // raster source. | 150 // raster source. |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 case LOWER_THAN_LOW_RES: | 584 case LOWER_THAN_LOW_RES: |
585 range = TilingRange(low_res_range.end, tilings_size); | 585 range = TilingRange(low_res_range.end, tilings_size); |
586 break; | 586 break; |
587 } | 587 } |
588 | 588 |
589 DCHECK_LE(range.start, range.end); | 589 DCHECK_LE(range.start, range.end); |
590 return range; | 590 return range; |
591 } | 591 } |
592 | 592 |
593 } // namespace cc | 593 } // namespace cc |
OLD | NEW |