| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 skewport_extrapolation_limit_in_content_pixels_( | 56 skewport_extrapolation_limit_in_content_pixels_( |
| 57 skewport_extrapolation_limit_in_content_pixels), | 57 skewport_extrapolation_limit_in_content_pixels), |
| 58 tree_(tree), | 58 tree_(tree), |
| 59 client_(client) {} | 59 client_(client) {} |
| 60 | 60 |
| 61 PictureLayerTilingSet::~PictureLayerTilingSet() { | 61 PictureLayerTilingSet::~PictureLayerTilingSet() { |
| 62 } | 62 } |
| 63 | 63 |
| 64 void PictureLayerTilingSet::CopyTilingsAndPropertiesFromPendingTwin( | 64 void PictureLayerTilingSet::CopyTilingsAndPropertiesFromPendingTwin( |
| 65 const PictureLayerTilingSet* pending_twin_set, | 65 const PictureLayerTilingSet* pending_twin_set, |
| 66 const scoped_refptr<DisplayListRasterSource>& raster_source, | 66 scoped_refptr<DisplayListRasterSource> raster_source, |
| 67 const Region& layer_invalidation) { | 67 const Region& layer_invalidation) { |
| 68 if (pending_twin_set->tilings_.empty()) { | 68 if (pending_twin_set->tilings_.empty()) { |
| 69 // If the twin (pending) tiling set is empty, it was not updated for the | 69 // If the twin (pending) tiling set is empty, it was not updated for the |
| 70 // current frame. So we drop tilings from our set as well, instead of | 70 // current frame. So we drop tilings from our set as well, instead of |
| 71 // leaving behind unshared tilings that are all non-ideal. | 71 // leaving behind unshared tilings that are all non-ideal. |
| 72 RemoveAllTilings(); | 72 RemoveAllTilings(); |
| 73 return; | 73 return; |
| 74 } | 74 } |
| 75 | 75 |
| 76 bool tiling_sort_required = false; | 76 bool tiling_sort_required = false; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 // This is needed for cases where the live tiles rect didn't change but | 156 // This is needed for cases where the live tiles rect didn't change but |
| 157 // recordings exist in the raster source that did not exist on the last | 157 // recordings exist in the raster source that did not exist on the last |
| 158 // raster source. | 158 // raster source. |
| 159 tiling->CreateMissingTilesInLiveTilesRect(); | 159 tiling->CreateMissingTilesInLiveTilesRect(); |
| 160 } | 160 } |
| 161 VerifyTilings(nullptr /* pending_twin_set */); | 161 VerifyTilings(nullptr /* pending_twin_set */); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void PictureLayerTilingSet::UpdateRasterSourceDueToLCDChange( | 164 void PictureLayerTilingSet::UpdateRasterSourceDueToLCDChange( |
| 165 const scoped_refptr<DisplayListRasterSource>& raster_source, | 165 scoped_refptr<DisplayListRasterSource> raster_source, |
| 166 const Region& layer_invalidation) { | 166 const Region& layer_invalidation) { |
| 167 for (const auto& tiling : tilings_) { | 167 for (const auto& tiling : tilings_) { |
| 168 tiling->SetRasterSourceAndResize(raster_source); | 168 tiling->SetRasterSourceAndResize(raster_source); |
| 169 tiling->Invalidate(layer_invalidation); | 169 tiling->Invalidate(layer_invalidation); |
| 170 // Since the invalidation changed, we need to create any missing tiles in | 170 // Since the invalidation changed, we need to create any missing tiles in |
| 171 // the live tiles rect again. | 171 // the live tiles rect again. |
| 172 tiling->CreateMissingTilesInLiveTilesRect(); | 172 tiling->CreateMissingTilesInLiveTilesRect(); |
| 173 } | 173 } |
| 174 } | 174 } |
| 175 | 175 |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 case LOWER_THAN_LOW_RES: | 586 case LOWER_THAN_LOW_RES: |
| 587 range = TilingRange(low_res_range.end, tilings_size); | 587 range = TilingRange(low_res_range.end, tilings_size); |
| 588 break; | 588 break; |
| 589 } | 589 } |
| 590 | 590 |
| 591 DCHECK_LE(range.start, range.end); | 591 DCHECK_LE(range.start, range.end); |
| 592 return range; | 592 return range; |
| 593 } | 593 } |
| 594 | 594 |
| 595 } // namespace cc | 595 } // namespace cc |
| OLD | NEW |