| 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. |
| 59 // |pending_twin_set| represents the current pending twin. In situations where |
| 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. |
| 58 void UpdateTilingsToCurrentRasterSource( | 64 void UpdateTilingsToCurrentRasterSource( |
| 59 scoped_refptr<RasterSource> raster_source, | 65 scoped_refptr<RasterSource> raster_source, |
| 60 const PictureLayerTilingSet* twin_set, | 66 const PictureLayerTilingSet* pending_twin_set, |
| 61 const Region& layer_invalidation, | 67 const Region& layer_invalidation, |
| 62 float minimum_contents_scale, | 68 float minimum_contents_scale, |
| 63 float maximum_contents_scale); | 69 float maximum_contents_scale); |
| 64 | 70 |
| 65 PictureLayerTiling* AddTiling(float contents_scale, | 71 PictureLayerTiling* AddTiling(float contents_scale, |
| 66 scoped_refptr<RasterSource> raster_source); | 72 scoped_refptr<RasterSource> raster_source); |
| 67 size_t num_tilings() const { return tilings_.size(); } | 73 size_t num_tilings() const { return tilings_.size(); } |
| 68 int NumHighResTilings() const; | 74 int NumHighResTilings() const; |
| 69 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; } | 75 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx]; } |
| 70 const PictureLayerTiling* tiling_at(size_t idx) const { | 76 const PictureLayerTiling* tiling_at(size_t idx) const { |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 162 |
| 157 TilingRange GetTilingRange(TilingRangeType type) const; | 163 TilingRange GetTilingRange(TilingRangeType type) const; |
| 158 | 164 |
| 159 private: | 165 private: |
| 160 explicit PictureLayerTilingSet( | 166 explicit PictureLayerTilingSet( |
| 161 PictureLayerTilingClient* client, | 167 PictureLayerTilingClient* client, |
| 162 size_t max_tiles_for_interest_area, | 168 size_t max_tiles_for_interest_area, |
| 163 float skewport_target_time_in_seconds, | 169 float skewport_target_time_in_seconds, |
| 164 int skewport_extrapolation_limit_in_content_pixels); | 170 int skewport_extrapolation_limit_in_content_pixels); |
| 165 | 171 |
| 172 void CopyTilingsFromPendingTwin( |
| 173 const PictureLayerTilingSet* pending_twin_set, |
| 174 const scoped_refptr<RasterSource>& raster_source); |
| 175 |
| 166 // Remove one tiling. | 176 // Remove one tiling. |
| 167 void Remove(PictureLayerTiling* tiling); | 177 void Remove(PictureLayerTiling* tiling); |
| 168 | 178 |
| 169 ScopedPtrVector<PictureLayerTiling> tilings_; | 179 ScopedPtrVector<PictureLayerTiling> tilings_; |
| 170 | 180 |
| 171 const size_t max_tiles_for_interest_area_; | 181 const size_t max_tiles_for_interest_area_; |
| 172 const float skewport_target_time_in_seconds_; | 182 const float skewport_target_time_in_seconds_; |
| 173 const int skewport_extrapolation_limit_in_content_pixels_; | 183 const int skewport_extrapolation_limit_in_content_pixels_; |
| 174 PictureLayerTilingClient* client_; | 184 PictureLayerTilingClient* client_; |
| 175 | 185 |
| 176 friend class Iterator; | 186 friend class Iterator; |
| 177 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 187 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
| 178 }; | 188 }; |
| 179 | 189 |
| 180 } // namespace cc | 190 } // namespace cc |
| 181 | 191 |
| 182 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 192 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
| OLD | NEW |