| 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 18 matching lines...) Expand all Loading... |
| 29 BETWEEN_HIGH_AND_LOW_RES, | 29 BETWEEN_HIGH_AND_LOW_RES, |
| 30 LOW_RES, | 30 LOW_RES, |
| 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 struct Pair { |
| 40 PictureLayerTilingSet* active = nullptr; |
| 41 PictureLayerTilingSet* pending = nullptr; |
| 42 }; |
| 39 | 43 |
| 40 static scoped_ptr<PictureLayerTilingSet> Create( | 44 static scoped_ptr<PictureLayerTilingSet> Create( |
| 41 PictureLayerTilingClient* client, | 45 PictureLayerTilingClient* client, |
| 42 size_t max_tiles_for_interest_area, | 46 size_t max_tiles_for_interest_area, |
| 43 float skewport_target_time_in_seconds, | 47 float skewport_target_time_in_seconds, |
| 44 int skewport_extrapolation_limit_in_content); | 48 int skewport_extrapolation_limit_in_content); |
| 45 | 49 |
| 46 ~PictureLayerTilingSet(); | 50 ~PictureLayerTilingSet(); |
| 47 | 51 |
| 48 const PictureLayerTilingClient* client() const { return client_; } | 52 const PictureLayerTilingClient* client() const { return client_; } |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 105 |
| 102 // Update the rects and priorities for tiles based on the given information. | 106 // Update the rects and priorities for tiles based on the given information. |
| 103 bool UpdateTilePriorities(const gfx::Rect& required_rect_in_layer_space, | 107 bool UpdateTilePriorities(const gfx::Rect& required_rect_in_layer_space, |
| 104 float ideal_contents_scale, | 108 float ideal_contents_scale, |
| 105 double current_frame_time_in_seconds, | 109 double current_frame_time_in_seconds, |
| 106 const Occlusion& occlusion_in_layer_space, | 110 const Occlusion& occlusion_in_layer_space, |
| 107 bool can_require_tiles_for_activation); | 111 bool can_require_tiles_for_activation); |
| 108 | 112 |
| 109 void GetAllTilesForTracing(std::set<const Tile*>* tiles) const; | 113 void GetAllTilesForTracing(std::set<const Tile*>* tiles) const; |
| 110 | 114 |
| 115 bool HasValidTilePriorities() const; |
| 116 |
| 111 // For a given rect, iterates through tiles that can fill it. If no | 117 // For a given rect, iterates through tiles that can fill it. If no |
| 112 // set of tiles with resources can fill the rect, then it will iterate | 118 // set of tiles with resources can fill the rect, then it will iterate |
| 113 // through null tiles with valid geometry_rect() until the rect is full. | 119 // through null tiles with valid geometry_rect() until the rect is full. |
| 114 // If all tiles have resources, the union of all geometry_rects will | 120 // If all tiles have resources, the union of all geometry_rects will |
| 115 // exactly fill rect with no overlap. | 121 // exactly fill rect with no overlap. |
| 116 class CC_EXPORT CoverageIterator { | 122 class CC_EXPORT CoverageIterator { |
| 117 public: | 123 public: |
| 118 CoverageIterator(const PictureLayerTilingSet* set, | 124 CoverageIterator(const PictureLayerTilingSet* set, |
| 119 float contents_scale, | 125 float contents_scale, |
| 120 const gfx::Rect& content_rect, | 126 const gfx::Rect& content_rect, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 const int skewport_extrapolation_limit_in_content_pixels_; | 179 const int skewport_extrapolation_limit_in_content_pixels_; |
| 174 PictureLayerTilingClient* client_; | 180 PictureLayerTilingClient* client_; |
| 175 | 181 |
| 176 friend class Iterator; | 182 friend class Iterator; |
| 177 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 183 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
| 178 }; | 184 }; |
| 179 | 185 |
| 180 } // namespace cc | 186 } // namespace cc |
| 181 | 187 |
| 182 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ | 188 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_SET_H_ |
| OLD | NEW |