| 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_TILES_PICTURE_LAYER_TILING_SET_H_ | 5 #ifndef CC_TILES_PICTURE_LAYER_TILING_SET_H_ |
| 6 #define CC_TILES_PICTURE_LAYER_TILING_SET_H_ | 6 #define CC_TILES_PICTURE_LAYER_TILING_SET_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 struct TilingRange { | 33 struct TilingRange { |
| 34 TilingRange(size_t start, size_t end) : start(start), end(end) {} | 34 TilingRange(size_t start, size_t end) : start(start), end(end) {} |
| 35 | 35 |
| 36 size_t start; | 36 size_t start; |
| 37 size_t end; | 37 size_t end; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 static scoped_ptr<PictureLayerTilingSet> Create( | 40 static scoped_ptr<PictureLayerTilingSet> Create( |
| 41 WhichTree tree, | 41 WhichTree tree, |
| 42 PictureLayerTilingClient* client, | 42 PictureLayerTilingClient* client, |
| 43 float tiling_interest_area_viewport_multiplier, | 43 size_t max_tiles_for_interest_area, |
| 44 float skewport_target_time_in_seconds, | 44 float skewport_target_time_in_seconds, |
| 45 int skewport_extrapolation_limit_in_content); | 45 int skewport_extrapolation_limit_in_content); |
| 46 | 46 |
| 47 ~PictureLayerTilingSet(); | 47 ~PictureLayerTilingSet(); |
| 48 | 48 |
| 49 const PictureLayerTilingClient* client() const { return client_; } | 49 const PictureLayerTilingClient* client() const { return client_; } |
| 50 | 50 |
| 51 void CleanUpTilings(float min_acceptable_high_res_scale, | 51 void CleanUpTilings(float min_acceptable_high_res_scale, |
| 52 float max_acceptable_high_res_scale, | 52 float max_acceptable_high_res_scale, |
| 53 const std::vector<PictureLayerTiling*>& needed_tilings, | 53 const std::vector<PictureLayerTiling*>& needed_tilings, |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 void AsValueInto(base::trace_event::TracedValue* array) const; | 169 void AsValueInto(base::trace_event::TracedValue* array) const; |
| 170 size_t GPUMemoryUsageInBytes() const; | 170 size_t GPUMemoryUsageInBytes() const; |
| 171 | 171 |
| 172 TilingRange GetTilingRange(TilingRangeType type) const; | 172 TilingRange GetTilingRange(TilingRangeType type) const; |
| 173 | 173 |
| 174 private: | 174 private: |
| 175 explicit PictureLayerTilingSet( | 175 explicit PictureLayerTilingSet( |
| 176 WhichTree tree, | 176 WhichTree tree, |
| 177 PictureLayerTilingClient* client, | 177 PictureLayerTilingClient* client, |
| 178 float tiling_interest_area_viewport_multiplier, | 178 size_t max_tiles_for_interest_area, |
| 179 float skewport_target_time_in_seconds, | 179 float skewport_target_time_in_seconds, |
| 180 int skewport_extrapolation_limit_in_content_pixels); | 180 int skewport_extrapolation_limit_in_content_pixels); |
| 181 | 181 |
| 182 void CopyTilingsAndPropertiesFromPendingTwin( | 182 void CopyTilingsAndPropertiesFromPendingTwin( |
| 183 const PictureLayerTilingSet* pending_twin_set, | 183 const PictureLayerTilingSet* pending_twin_set, |
| 184 const scoped_refptr<RasterSource>& raster_source, | 184 const scoped_refptr<RasterSource>& raster_source, |
| 185 const Region& layer_invalidation); | 185 const Region& layer_invalidation); |
| 186 | 186 |
| 187 // Remove one tiling. | 187 // Remove one tiling. |
| 188 void Remove(PictureLayerTiling* tiling); | 188 void Remove(PictureLayerTiling* tiling); |
| 189 void VerifyTilings(const PictureLayerTilingSet* pending_twin_set) const; | 189 void VerifyTilings(const PictureLayerTilingSet* pending_twin_set) const; |
| 190 | 190 |
| 191 ScopedPtrVector<PictureLayerTiling> tilings_; | 191 ScopedPtrVector<PictureLayerTiling> tilings_; |
| 192 | 192 |
| 193 const float tiling_interest_area_viewport_multiplier_; | 193 const size_t max_tiles_for_interest_area_; |
| 194 const float skewport_target_time_in_seconds_; | 194 const float skewport_target_time_in_seconds_; |
| 195 const int skewport_extrapolation_limit_in_content_pixels_; | 195 const int skewport_extrapolation_limit_in_content_pixels_; |
| 196 WhichTree tree_; | 196 WhichTree tree_; |
| 197 PictureLayerTilingClient* client_; | 197 PictureLayerTilingClient* client_; |
| 198 | 198 |
| 199 friend class Iterator; | 199 friend class Iterator; |
| 200 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 200 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
| 201 }; | 201 }; |
| 202 | 202 |
| 203 } // namespace cc | 203 } // namespace cc |
| 204 | 204 |
| 205 #endif // CC_TILES_PICTURE_LAYER_TILING_SET_H_ | 205 #endif // CC_TILES_PICTURE_LAYER_TILING_SET_H_ |
| OLD | NEW |