| 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 20 matching lines...) Expand all Loading... |
| 31 LOWER_THAN_LOW_RES | 31 LOWER_THAN_LOW_RES |
| 32 }; | 32 }; |
| 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 PictureLayerTilingClient* client); | 41 PictureLayerTilingClient* client, |
| 42 size_t max_tiles_For_interest_area, |
| 43 float skewport_target_time_in_seconds, |
| 44 int skewport_extrapolation_limit_in_content); |
| 42 | 45 |
| 43 ~PictureLayerTilingSet(); | 46 ~PictureLayerTilingSet(); |
| 44 | 47 |
| 45 void SetClient(PictureLayerTilingClient* client); | 48 void SetClient(PictureLayerTilingClient* client); |
| 46 const PictureLayerTilingClient* client() const { return client_; } | 49 const PictureLayerTilingClient* client() const { return client_; } |
| 47 | 50 |
| 48 void RemoveTilesInRegion(const Region& region); | 51 void RemoveTilesInRegion(const Region& region); |
| 49 void CleanUpTilings(float min_acceptable_high_res_scale, | 52 void CleanUpTilings(float min_acceptable_high_res_scale, |
| 50 float max_acceptable_high_res_scale, | 53 float max_acceptable_high_res_scale, |
| 51 const std::vector<PictureLayerTiling*>& needed_tilings, | 54 const std::vector<PictureLayerTiling*>& needed_tilings, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // Remove all tiles; keep all tilings. | 98 // Remove all tiles; keep all tilings. |
| 96 void RemoveAllTiles(); | 99 void RemoveAllTiles(); |
| 97 | 100 |
| 98 // Update the rects and priorities for tiles based on the given information. | 101 // Update the rects and priorities for tiles based on the given information. |
| 99 bool UpdateTilePriorities(const gfx::Rect& required_rect_in_layer_space, | 102 bool UpdateTilePriorities(const gfx::Rect& required_rect_in_layer_space, |
| 100 float ideal_contents_scale, | 103 float ideal_contents_scale, |
| 101 double current_frame_time_in_seconds, | 104 double current_frame_time_in_seconds, |
| 102 const Occlusion& occlusion_in_layer_space, | 105 const Occlusion& occlusion_in_layer_space, |
| 103 bool can_require_tiles_for_activation); | 106 bool can_require_tiles_for_activation); |
| 104 | 107 |
| 108 void SetMaxTilesForInterestArea(size_t max_tiles_for_interest_area) { |
| 109 max_tiles_for_interest_area_ = max_tiles_for_interest_area; |
| 110 } |
| 111 void SetSkewportTargetTimeInSeconds(float skewport_target_time_in_seconds) { |
| 112 skewport_target_time_in_seconds_ = skewport_target_time_in_seconds; |
| 113 } |
| 114 void SetSkewportExtrapolationLimitInContentPixels( |
| 115 int skewport_extrapolation_limit_in_content_pixels) { |
| 116 skewport_extrapolation_limit_in_content_pixels_ = |
| 117 skewport_extrapolation_limit_in_content_pixels; |
| 118 } |
| 119 |
| 105 void GetAllTilesForTracing(std::set<const Tile*>* tiles) const; | 120 void GetAllTilesForTracing(std::set<const Tile*>* tiles) const; |
| 106 | 121 |
| 107 // For a given rect, iterates through tiles that can fill it. If no | 122 // For a given rect, iterates through tiles that can fill it. If no |
| 108 // set of tiles with resources can fill the rect, then it will iterate | 123 // set of tiles with resources can fill the rect, then it will iterate |
| 109 // through null tiles with valid geometry_rect() until the rect is full. | 124 // through null tiles with valid geometry_rect() until the rect is full. |
| 110 // If all tiles have resources, the union of all geometry_rects will | 125 // If all tiles have resources, the union of all geometry_rects will |
| 111 // exactly fill rect with no overlap. | 126 // exactly fill rect with no overlap. |
| 112 class CC_EXPORT CoverageIterator { | 127 class CC_EXPORT CoverageIterator { |
| 113 public: | 128 public: |
| 114 CoverageIterator(const PictureLayerTilingSet* set, | 129 CoverageIterator(const PictureLayerTilingSet* set, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 size_t GPUMemoryUsageInBytes() const; | 168 size_t GPUMemoryUsageInBytes() const; |
| 154 | 169 |
| 155 TilingRange GetTilingRange(TilingRangeType type) const; | 170 TilingRange GetTilingRange(TilingRangeType type) const; |
| 156 | 171 |
| 157 private: | 172 private: |
| 158 explicit PictureLayerTilingSet(PictureLayerTilingClient* client); | 173 explicit PictureLayerTilingSet(PictureLayerTilingClient* client); |
| 159 | 174 |
| 160 // Remove one tiling. | 175 // Remove one tiling. |
| 161 void Remove(PictureLayerTiling* tiling); | 176 void Remove(PictureLayerTiling* tiling); |
| 162 | 177 |
| 178 ScopedPtrVector<PictureLayerTiling> tilings_; |
| 179 |
| 180 size_t max_tiles_for_interest_area_; |
| 181 float skewport_target_time_in_seconds_; |
| 182 int skewport_extrapolation_limit_in_content_pixels_; |
| 163 PictureLayerTilingClient* client_; | 183 PictureLayerTilingClient* client_; |
| 164 ScopedPtrVector<PictureLayerTiling> tilings_; | |
| 165 | 184 |
| 166 friend class Iterator; | 185 friend class Iterator; |
| 167 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 186 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
| 168 }; | 187 }; |
| 169 | 188 |
| 170 } // namespace cc | 189 } // namespace cc |
| 171 | 190 |
| 172 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 191 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
| OLD | NEW |