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 <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 scoped_refptr<RasterSource> raster_source, | 69 scoped_refptr<RasterSource> raster_source, |
70 const Region& layer_invalidation, | 70 const Region& layer_invalidation, |
71 float minimum_contents_scale, | 71 float minimum_contents_scale, |
72 float maximum_contents_scale); | 72 float maximum_contents_scale); |
73 | 73 |
74 // This function is called on the sync tree right after commit. | 74 // This function is called on the sync tree right after commit. |
75 void UpdateRasterSourceDueToLCDChange( | 75 void UpdateRasterSourceDueToLCDChange( |
76 scoped_refptr<RasterSource> raster_source, | 76 scoped_refptr<RasterSource> raster_source, |
77 const Region& layer_invalidation); | 77 const Region& layer_invalidation); |
78 | 78 |
79 PictureLayerTiling* AddTiling(float contents_scale, | 79 PictureLayerTiling* AddTiling(const ScaleTranslate2d& contents_transform, |
80 scoped_refptr<RasterSource> raster_source); | 80 scoped_refptr<RasterSource> raster_source); |
81 size_t num_tilings() const { return tilings_.size(); } | 81 size_t num_tilings() const { return tilings_.size(); } |
82 int NumHighResTilings() const; | 82 int NumHighResTilings() const; |
83 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx].get(); } | 83 PictureLayerTiling* tiling_at(size_t idx) { return tilings_[idx].get(); } |
84 const PictureLayerTiling* tiling_at(size_t idx) const { | 84 const PictureLayerTiling* tiling_at(size_t idx) const { |
85 return tilings_[idx].get(); | 85 return tilings_[idx].get(); |
86 } | 86 } |
87 WhichTree tree() const { return tree_; } | 87 WhichTree tree() const { return tree_; } |
88 | 88 |
89 PictureLayerTiling* FindTilingWithScale(float scale) const; | 89 PictureLayerTiling* FindTilingWithScale(float scale) const; |
(...skipping 17 matching lines...) Expand all Loading... |
107 | 107 |
108 // Removes all tilings with a contents scale > |maximum_scale|. | 108 // Removes all tilings with a contents scale > |maximum_scale|. |
109 void RemoveTilingsAboveScale(float maximum_scale); | 109 void RemoveTilingsAboveScale(float maximum_scale); |
110 | 110 |
111 // Remove all tilings. | 111 // Remove all tilings. |
112 void RemoveAllTilings(); | 112 void RemoveAllTilings(); |
113 | 113 |
114 // Remove all tiles; keep all tilings. | 114 // Remove all tiles; keep all tilings. |
115 void RemoveAllTiles(); | 115 void RemoveAllTiles(); |
116 | 116 |
| 117 // Remove one tiling. |
| 118 void Remove(PictureLayerTiling* tiling); |
| 119 |
117 // Update the rects and priorities for tiles based on the given information. | 120 // Update the rects and priorities for tiles based on the given information. |
118 // Returns true if PrepareTiles is required. | 121 // Returns true if PrepareTiles is required. |
119 bool UpdateTilePriorities(const gfx::Rect& required_rect_in_layer_space, | 122 bool UpdateTilePriorities(const gfx::Rect& required_rect_in_layer_space, |
120 float ideal_contents_scale, | 123 float ideal_contents_scale, |
121 double current_frame_time_in_seconds, | 124 double current_frame_time_in_seconds, |
122 const Occlusion& occlusion_in_layer_space, | 125 const Occlusion& occlusion_in_layer_space, |
123 bool can_require_tiles_for_activation); | 126 bool can_require_tiles_for_activation); |
124 | 127 |
125 void GetAllPrioritizedTilesForTracing( | 128 void GetAllPrioritizedTilesForTracing( |
126 std::vector<PrioritizedTile>* prioritized_tiles) const; | 129 std::vector<PrioritizedTile>* prioritized_tiles) const; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 PictureLayerTilingClient* client, | 209 PictureLayerTilingClient* client, |
207 int tiling_interest_area_padding, | 210 int tiling_interest_area_padding, |
208 float skewport_target_time_in_seconds, | 211 float skewport_target_time_in_seconds, |
209 int skewport_extrapolation_limit_in_screen_pixels); | 212 int skewport_extrapolation_limit_in_screen_pixels); |
210 | 213 |
211 void CopyTilingsAndPropertiesFromPendingTwin( | 214 void CopyTilingsAndPropertiesFromPendingTwin( |
212 const PictureLayerTilingSet* pending_twin_set, | 215 const PictureLayerTilingSet* pending_twin_set, |
213 scoped_refptr<RasterSource> raster_source, | 216 scoped_refptr<RasterSource> raster_source, |
214 const Region& layer_invalidation); | 217 const Region& layer_invalidation); |
215 | 218 |
216 // Remove one tiling. | |
217 void Remove(PictureLayerTiling* tiling); | |
218 void VerifyTilings(const PictureLayerTilingSet* pending_twin_set) const; | 219 void VerifyTilings(const PictureLayerTilingSet* pending_twin_set) const; |
219 | 220 |
220 bool TilingsNeedUpdate(const gfx::Rect& required_rect_in_layer_space, | 221 bool TilingsNeedUpdate(const gfx::Rect& required_rect_in_layer_space, |
221 double current_frame_time_in_Seconds); | 222 double current_frame_time_in_Seconds); |
222 gfx::Rect ComputeSkewport(const gfx::Rect& visible_rect_in_layer_space, | 223 gfx::Rect ComputeSkewport(const gfx::Rect& visible_rect_in_layer_space, |
223 double current_frame_time_in_seconds, | 224 double current_frame_time_in_seconds, |
224 float ideal_contents_scale); | 225 float ideal_contents_scale); |
225 gfx::Rect ComputeSoonBorderRect(const gfx::Rect& visible_rect_in_layer_space, | 226 gfx::Rect ComputeSoonBorderRect(const gfx::Rect& visible_rect_in_layer_space, |
226 float ideal_contents_scale); | 227 float ideal_contents_scale); |
227 void UpdatePriorityRects(const gfx::Rect& visible_rect_in_layer_space, | 228 void UpdatePriorityRects(const gfx::Rect& visible_rect_in_layer_space, |
(...skipping 21 matching lines...) Expand all Loading... |
249 | 250 |
250 friend class Iterator; | 251 friend class Iterator; |
251 | 252 |
252 private: | 253 private: |
253 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 254 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
254 }; | 255 }; |
255 | 256 |
256 } // namespace cc | 257 } // namespace cc |
257 | 258 |
258 #endif // CC_TILES_PICTURE_LAYER_TILING_SET_H_ | 259 #endif // CC_TILES_PICTURE_LAYER_TILING_SET_H_ |
OLD | NEW |