Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: cc/resources/picture_layer_tiling.h

Issue 1126793002: cc: Make tiling interest rect calc based on viewport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use new settings for interest rect calc. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_H_ 5 #ifndef CC_RESOURCES_PICTURE_LAYER_TILING_H_
6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_ 6 #define CC_RESOURCES_PICTURE_LAYER_TILING_H_
7 7
8 #include <map> 8 #include <map>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 static float CalculateSoonBorderDistance( 61 static float CalculateSoonBorderDistance(
62 const gfx::Rect& visible_rect_in_content_space, 62 const gfx::Rect& visible_rect_in_content_space,
63 float content_to_screen_scale); 63 float content_to_screen_scale);
64 64
65 // Create a tiling with no tiles. CreateTile() must be called to add some. 65 // Create a tiling with no tiles. CreateTile() must be called to add some.
66 static scoped_ptr<PictureLayerTiling> Create( 66 static scoped_ptr<PictureLayerTiling> Create(
67 WhichTree tree, 67 WhichTree tree,
68 float contents_scale, 68 float contents_scale,
69 scoped_refptr<RasterSource> raster_source, 69 scoped_refptr<RasterSource> raster_source,
70 PictureLayerTilingClient* client, 70 PictureLayerTilingClient* client,
71 size_t max_tiles_for_interest_area, 71 size_t tiling_interest_area_viewport_multiplier,
72 float skewport_target_time_in_seconds, 72 float skewport_target_time_in_seconds,
73 int skewport_extrapolation_limit_in_content_pixels); 73 int skewport_extrapolation_limit_in_content_pixels);
74 74
75 void SetRasterSourceAndResize(scoped_refptr<RasterSource> raster_source); 75 void SetRasterSourceAndResize(scoped_refptr<RasterSource> raster_source);
76 void Invalidate(const Region& layer_invalidation); 76 void Invalidate(const Region& layer_invalidation);
77 void SetRasterSourceOnTiles(); 77 void SetRasterSourceOnTiles();
78 void CreateMissingTilesInLiveTilesRect(); 78 void CreateMissingTilesInLiveTilesRect();
79 void TakeTilesAndPropertiesFrom(PictureLayerTiling* pending_twin, 79 void TakeTilesAndPropertiesFrom(PictureLayerTiling* pending_twin,
80 const Region& layer_invalidation); 80 const Region& layer_invalidation);
81 81
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 struct FrameVisibleRect { 221 struct FrameVisibleRect {
222 gfx::Rect visible_rect_in_content_space; 222 gfx::Rect visible_rect_in_content_space;
223 double frame_time_in_seconds = 0.0; 223 double frame_time_in_seconds = 0.0;
224 }; 224 };
225 225
226 PictureLayerTiling(WhichTree tree, 226 PictureLayerTiling(WhichTree tree,
227 float contents_scale, 227 float contents_scale,
228 scoped_refptr<RasterSource> raster_source, 228 scoped_refptr<RasterSource> raster_source,
229 PictureLayerTilingClient* client, 229 PictureLayerTilingClient* client,
230 size_t max_tiles_for_interest_area, 230 size_t tiling_interest_area_viewport_multiplier,
231 float skewport_target_time_in_seconds, 231 float skewport_target_time_in_seconds,
232 int skewport_extrapolation_limit_in_content_pixels); 232 int skewport_extrapolation_limit_in_content_pixels);
233 void SetLiveTilesRect(const gfx::Rect& live_tiles_rect); 233 void SetLiveTilesRect(const gfx::Rect& live_tiles_rect);
234 void VerifyLiveTilesRect(bool is_on_recycle_tree) const; 234 void VerifyLiveTilesRect(bool is_on_recycle_tree) const;
235 Tile* CreateTile(int i, int j); 235 Tile* CreateTile(int i, int j);
236 // Returns true if the Tile existed and was removed from the tiling. 236 // Returns true if the Tile existed and was removed from the tiling.
237 bool RemoveTileAt(int i, int j); 237 bool RemoveTileAt(int i, int j);
238 bool TilingMatchesTileIndices(const PictureLayerTiling* twin) const; 238 bool TilingMatchesTileIndices(const PictureLayerTiling* twin) const;
239 239
240 // Computes a skewport. The calculation extrapolates the last visible 240 // Computes a skewport. The calculation extrapolates the last visible
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 return current_soon_border_rect_; 301 return current_soon_border_rect_;
302 } 302 }
303 const gfx::Rect& current_eventually_rect() const { 303 const gfx::Rect& current_eventually_rect() const {
304 return current_eventually_rect_; 304 return current_eventually_rect_;
305 } 305 }
306 bool has_ever_been_updated() const { 306 bool has_ever_been_updated() const {
307 return visible_rect_history_[0].frame_time_in_seconds != 0.0; 307 return visible_rect_history_[0].frame_time_in_seconds != 0.0;
308 } 308 }
309 void RemoveTilesInRegion(const Region& layer_region, bool recreate_tiles); 309 void RemoveTilesInRegion(const Region& layer_region, bool recreate_tiles);
310 310
311 const size_t max_tiles_for_interest_area_; 311 const size_t tiling_interest_area_viewport_multiplier_;
vmpstr 2015/05/06 17:57:29 Let's make the multiplier be a float to allow for
sohanjg 2015/05/07 14:42:10 Done.
312 const float skewport_target_time_in_seconds_; 312 const float skewport_target_time_in_seconds_;
313 const int skewport_extrapolation_limit_in_content_pixels_; 313 const int skewport_extrapolation_limit_in_content_pixels_;
314 314
315 // Given properties. 315 // Given properties.
316 const float contents_scale_; 316 const float contents_scale_;
317 PictureLayerTilingClient* const client_; 317 PictureLayerTilingClient* const client_;
318 const WhichTree tree_; 318 const WhichTree tree_;
319 scoped_refptr<RasterSource> raster_source_; 319 scoped_refptr<RasterSource> raster_source_;
320 TileResolution resolution_; 320 TileResolution resolution_;
321 321
(...skipping 24 matching lines...) Expand all
346 346
347 private: 347 private:
348 DISALLOW_ASSIGN(PictureLayerTiling); 348 DISALLOW_ASSIGN(PictureLayerTiling);
349 349
350 RectExpansionCache expansion_cache_; 350 RectExpansionCache expansion_cache_;
351 }; 351 };
352 352
353 } // namespace cc 353 } // namespace cc
354 354
355 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ 355 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698