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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 size_t start; | 38 size_t start; |
39 size_t end; | 39 size_t end; |
40 }; | 40 }; |
41 | 41 |
42 static std::unique_ptr<PictureLayerTilingSet> Create( | 42 static std::unique_ptr<PictureLayerTilingSet> Create( |
43 WhichTree tree, | 43 WhichTree tree, |
44 PictureLayerTilingClient* client, | 44 PictureLayerTilingClient* client, |
45 int tiling_interest_area_padding, | 45 int tiling_interest_area_padding, |
46 float skewport_target_time_in_seconds, | 46 float skewport_target_time_in_seconds, |
47 int skewport_extrapolation_limit_in_screen_pixels); | 47 int skewport_extrapolation_limit_in_screen_pixels, |
| 48 float max_preraster_distance); |
48 | 49 |
49 ~PictureLayerTilingSet(); | 50 ~PictureLayerTilingSet(); |
50 | 51 |
51 const PictureLayerTilingClient* client() const { return client_; } | 52 const PictureLayerTilingClient* client() const { return client_; } |
52 | 53 |
53 void CleanUpTilings(float min_acceptable_high_res_scale, | 54 void CleanUpTilings(float min_acceptable_high_res_scale, |
54 float max_acceptable_high_res_scale, | 55 float max_acceptable_high_res_scale, |
55 const std::vector<PictureLayerTiling*>& needed_tilings, | 56 const std::vector<PictureLayerTiling*>& needed_tilings, |
56 PictureLayerTilingSet* twin_set); | 57 PictureLayerTilingSet* twin_set); |
57 void RemoveNonIdealTilings(); | 58 void RemoveNonIdealTilings(); |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 200 |
200 bool invalidated; | 201 bool invalidated; |
201 bool added_tilings; | 202 bool added_tilings; |
202 }; | 203 }; |
203 | 204 |
204 explicit PictureLayerTilingSet( | 205 explicit PictureLayerTilingSet( |
205 WhichTree tree, | 206 WhichTree tree, |
206 PictureLayerTilingClient* client, | 207 PictureLayerTilingClient* client, |
207 int tiling_interest_area_padding, | 208 int tiling_interest_area_padding, |
208 float skewport_target_time_in_seconds, | 209 float skewport_target_time_in_seconds, |
209 int skewport_extrapolation_limit_in_screen_pixels); | 210 int skewport_extrapolation_limit_in_screen_pixels, |
| 211 float max_preraster_distance); |
210 | 212 |
211 void CopyTilingsAndPropertiesFromPendingTwin( | 213 void CopyTilingsAndPropertiesFromPendingTwin( |
212 const PictureLayerTilingSet* pending_twin_set, | 214 const PictureLayerTilingSet* pending_twin_set, |
213 scoped_refptr<RasterSource> raster_source, | 215 scoped_refptr<RasterSource> raster_source, |
214 const Region& layer_invalidation); | 216 const Region& layer_invalidation); |
215 | 217 |
216 // Remove one tiling. | 218 // Remove one tiling. |
217 void Remove(PictureLayerTiling* tiling); | 219 void Remove(PictureLayerTiling* tiling); |
218 void VerifyTilings(const PictureLayerTilingSet* pending_twin_set) const; | 220 void VerifyTilings(const PictureLayerTilingSet* pending_twin_set) const; |
219 | 221 |
220 bool TilingsNeedUpdate(const gfx::Rect& required_rect_in_layer_space, | 222 bool TilingsNeedUpdate(const gfx::Rect& required_rect_in_layer_space, |
221 double current_frame_time_in_Seconds); | 223 double current_frame_time_in_Seconds); |
222 gfx::Rect ComputeSkewport(const gfx::Rect& visible_rect_in_layer_space, | 224 gfx::Rect ComputeSkewport(const gfx::Rect& visible_rect_in_layer_space, |
223 double current_frame_time_in_seconds, | 225 double current_frame_time_in_seconds, |
224 float ideal_contents_scale); | 226 float ideal_contents_scale); |
225 gfx::Rect ComputeSoonBorderRect(const gfx::Rect& visible_rect_in_layer_space, | 227 gfx::Rect ComputeSoonBorderRect(const gfx::Rect& visible_rect_in_layer_space, |
226 float ideal_contents_scale); | 228 float ideal_contents_scale); |
227 void UpdatePriorityRects(const gfx::Rect& visible_rect_in_layer_space, | 229 void UpdatePriorityRects(const gfx::Rect& visible_rect_in_layer_space, |
228 double current_frame_time_in_seconds, | 230 double current_frame_time_in_seconds, |
229 float ideal_contents_scale); | 231 float ideal_contents_scale); |
230 | 232 |
231 std::vector<std::unique_ptr<PictureLayerTiling>> tilings_; | 233 std::vector<std::unique_ptr<PictureLayerTiling>> tilings_; |
232 | 234 |
233 const int tiling_interest_area_padding_; | 235 const int tiling_interest_area_padding_; |
234 const float skewport_target_time_in_seconds_; | 236 const float skewport_target_time_in_seconds_; |
235 const int skewport_extrapolation_limit_in_screen_pixels_; | 237 const int skewport_extrapolation_limit_in_screen_pixels_; |
236 WhichTree tree_; | 238 WhichTree tree_; |
237 PictureLayerTilingClient* client_; | 239 PictureLayerTilingClient* client_; |
| 240 const float max_preraster_distance_; |
238 // State saved for computing velocities based on finite differences. | 241 // State saved for computing velocities based on finite differences. |
239 // .front() of the list refers to the most recent FrameVisibleRect. | 242 // .front() of the list refers to the most recent FrameVisibleRect. |
240 std::list<FrameVisibleRect> visible_rect_history_; | 243 std::list<FrameVisibleRect> visible_rect_history_; |
241 StateSinceLastTilePriorityUpdate state_since_last_tile_priority_update_; | 244 StateSinceLastTilePriorityUpdate state_since_last_tile_priority_update_; |
242 | 245 |
243 scoped_refptr<RasterSource> raster_source_; | 246 scoped_refptr<RasterSource> raster_source_; |
244 | 247 |
245 gfx::Rect visible_rect_in_layer_space_; | 248 gfx::Rect visible_rect_in_layer_space_; |
246 gfx::Rect skewport_in_layer_space_; | 249 gfx::Rect skewport_in_layer_space_; |
247 gfx::Rect soon_border_rect_in_layer_space_; | 250 gfx::Rect soon_border_rect_in_layer_space_; |
248 gfx::Rect eventually_rect_in_layer_space_; | 251 gfx::Rect eventually_rect_in_layer_space_; |
249 | 252 |
250 friend class Iterator; | 253 friend class Iterator; |
251 | 254 |
252 private: | 255 private: |
253 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); | 256 DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
254 }; | 257 }; |
255 | 258 |
256 } // namespace cc | 259 } // namespace cc |
257 | 260 |
258 #endif // CC_TILES_PICTURE_LAYER_TILING_SET_H_ | 261 #endif // CC_TILES_PICTURE_LAYER_TILING_SET_H_ |
OLD | NEW |