| 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 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 5 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
| 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 const PictureLayerTilingClient* client() const { return client_; } | 48 const PictureLayerTilingClient* client() const { return client_; } |
| 49 | 49 |
| 50 void CleanUpTilings(float min_acceptable_high_res_scale, | 50 void CleanUpTilings(float min_acceptable_high_res_scale, |
| 51 float max_acceptable_high_res_scale, | 51 float max_acceptable_high_res_scale, |
| 52 const std::vector<PictureLayerTiling*>& needed_tilings, | 52 const std::vector<PictureLayerTiling*>& needed_tilings, |
| 53 bool should_have_low_res, | 53 bool should_have_low_res, |
| 54 PictureLayerTilingSet* twin_set, | 54 PictureLayerTilingSet* twin_set, |
| 55 PictureLayerTilingSet* recycled_twin_set); | 55 PictureLayerTilingSet* recycled_twin_set); |
| 56 void RemoveNonIdealTilings(); | 56 void RemoveNonIdealTilings(); |
| 57 | 57 |
| 58 // This function can be called on both the active and pending tree. | 58 // This function is called on the active tree during activation. |
| 59 // |pending_twin_set| represents the current pending twin. In situations where | 59 void UpdateTilingsToCurrentRasterSourceForActivation( |
| 60 // this is called on the active tree in two trees situations, | |
| 61 // |pending_twin_set| represents the tiling set from the pending twin layer. | |
| 62 // In situations where this is called on the sync tree (whether it's pending | |
| 63 // or active in cases of one tree), |pending_twin_set| should be nullptr. | |
| 64 void UpdateTilingsToCurrentRasterSource( | |
| 65 scoped_refptr<RasterSource> raster_source, | 60 scoped_refptr<RasterSource> raster_source, |
| 66 const PictureLayerTilingSet* pending_twin_set, | 61 const PictureLayerTilingSet* pending_twin_set, |
| 67 const Region& layer_invalidation, | 62 const Region& layer_invalidation, |
| 68 float minimum_contents_scale, | 63 float minimum_contents_scale, |
| 69 float maximum_contents_scale); | 64 float maximum_contents_scale); |
| 70 | 65 |
| 66 // This function is called on the sync tree during commit. |
| 67 void UpdateTilingsToCurrentRasterSourceForCommit( |
| 68 scoped_refptr<RasterSource> raster_source, |
| 69 const Region& layer_invalidation, |
| 70 float minimum_contents_scale, |
| 71 float maximum_contents_scale); |
| 72 |
| 73 // This function is called on the sync tree right after commit. |
| 74 void UpdateRasterSourceDueToLCDChange( |
| 75 const scoped_refptr<RasterSource>& raster_source, |
| 76 const Region& layer_invalidation); |
| 77 |
| 71 PictureLayerTiling* AddTiling(float contents_scale, | 78 PictureLayerTiling* AddTiling(float contents_scale, |
| 72 scoped_refptr<RasterSource> raster_source); | 79 scoped_refptr<RasterSource> raster_source); |
| 73 size_t num_tilings() const { return tilings_.size(); } | 80 size_t num_tilings() const { return tilings_.size(); } |
| 74 int NumHighResTilings() const; | 81 int NumHighResTilings() const; |
| 75 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; } | 82 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; } |
| 76 const PictureLayerTiling* tiling_at(size_t idx) const { | 83 const PictureLayerTiling* tiling_at(size_t idx) const { |
| 77 return tilings_[idx]; | 84 return tilings_[idx]; |
| 78 } | 85 } |
| 79 | 86 |
| 80 PictureLayerTiling* FindTilingWithScale(float scale) const; | 87 PictureLayerTiling* FindTilingWithScale(float scale) const; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 170 |
| 164 TilingRange GetTilingRange(TilingRangeType type) const; | 171 TilingRange GetTilingRange(TilingRangeType type) const; |
| 165 | 172 |
| 166 private: | 173 private: |
| 167 explicit PictureLayerTilingSet( | 174 explicit PictureLayerTilingSet( |
| 168 PictureLayerTilingClient* client, | 175 PictureLayerTilingClient* client, |
| 169 size_t max_tiles_for_interest_area, | 176 size_t max_tiles_for_interest_area, |
| 170 float skewport_target_time_in_seconds, | 177 float skewport_target_time_in_seconds, |
| 171 int skewport_extrapolation_limit_in_content_pixels); | 178 int skewport_extrapolation_limit_in_content_pixels); |
| 172 | 179 |
| 173 void CopyTilingsFromPendingTwin( | 180 void CopyTilingsAndPropertiesFromPendingTwin( |
| 174 const PictureLayerTilingSet* pending_twin_set, | 181 const PictureLayerTilingSet* pending_twin_set, |
| 175 const scoped_refptr<RasterSource>& raster_source); | 182 const scoped_refptr<RasterSource>& raster_source); |
| 176 | 183 |
| 177 // Remove one tiling. | 184 // Remove one tiling. |
| 178 void Remove(PictureLayerTiling* tiling); | 185 void Remove(PictureLayerTiling* tiling); |
| 186 void VerifyTilings(const PictureLayerTilingSet* pending_twin_set) const; |
| 179 | 187 |
| 180 ScopedPtrVector<PictureLayerTiling> tilings_; | 188 ScopedPtrVector<PictureLayerTiling> tilings_; |
| 181 | 189 |
| 182 const size_t max_tiles_for_interest_area_; | 190 const size_t max_tiles_for_interest_area_; |
| 183 const float skewport_target_time_in_seconds_; | 191 const float skewport_target_time_in_seconds_; |
| 184 const int skewport_extrapolation_limit_in_content_pixels_; | 192 const int skewport_extrapolation_limit_in_content_pixels_; |
| 185 PictureLayerTilingClient* client_; | 193 PictureLayerTilingClient* client_; |
| 186 | 194 |
| 187 friend class Iterator; | 195 friend class Iterator; |
| 188 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 196 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
| 189 }; | 197 }; |
| 190 | 198 |
| 191 } // namespace cc | 199 } // namespace cc |
| 192 | 200 |
| 193 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 201 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
| OLD | NEW |