| 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_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 Loading... |
| 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 float 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 214 |
| 215 struct FrameVisibleRect { | 215 struct FrameVisibleRect { |
| 216 gfx::Rect visible_rect_in_content_space; | 216 gfx::Rect visible_rect_in_content_space; |
| 217 double frame_time_in_seconds = 0.0; | 217 double frame_time_in_seconds = 0.0; |
| 218 }; | 218 }; |
| 219 | 219 |
| 220 PictureLayerTiling(WhichTree tree, | 220 PictureLayerTiling(WhichTree tree, |
| 221 float contents_scale, | 221 float contents_scale, |
| 222 scoped_refptr<RasterSource> raster_source, | 222 scoped_refptr<RasterSource> raster_source, |
| 223 PictureLayerTilingClient* client, | 223 PictureLayerTilingClient* client, |
| 224 size_t max_tiles_for_interest_area, | 224 float tiling_interest_area_viewport_multiplier, |
| 225 float skewport_target_time_in_seconds, | 225 float skewport_target_time_in_seconds, |
| 226 int skewport_extrapolation_limit_in_content_pixels); | 226 int skewport_extrapolation_limit_in_content_pixels); |
| 227 void SetLiveTilesRect(const gfx::Rect& live_tiles_rect); | 227 void SetLiveTilesRect(const gfx::Rect& live_tiles_rect); |
| 228 void VerifyLiveTilesRect(bool is_on_recycle_tree) const; | 228 void VerifyLiveTilesRect(bool is_on_recycle_tree) const; |
| 229 Tile* CreateTile(int i, int j); | 229 Tile* CreateTile(int i, int j); |
| 230 // Returns true if the Tile existed and was removed from the tiling. | 230 // Returns true if the Tile existed and was removed from the tiling. |
| 231 bool RemoveTileAt(int i, int j); | 231 bool RemoveTileAt(int i, int j); |
| 232 bool TilingMatchesTileIndices(const PictureLayerTiling* twin) const; | 232 bool TilingMatchesTileIndices(const PictureLayerTiling* twin) const; |
| 233 | 233 |
| 234 // Computes a skewport. The calculation extrapolates the last visible | 234 // Computes a skewport. The calculation extrapolates the last visible |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 return current_soon_border_rect_; | 295 return current_soon_border_rect_; |
| 296 } | 296 } |
| 297 const gfx::Rect& current_eventually_rect() const { | 297 const gfx::Rect& current_eventually_rect() const { |
| 298 return current_eventually_rect_; | 298 return current_eventually_rect_; |
| 299 } | 299 } |
| 300 bool has_ever_been_updated() const { | 300 bool has_ever_been_updated() const { |
| 301 return visible_rect_history_[0].frame_time_in_seconds != 0.0; | 301 return visible_rect_history_[0].frame_time_in_seconds != 0.0; |
| 302 } | 302 } |
| 303 void RemoveTilesInRegion(const Region& layer_region, bool recreate_tiles); | 303 void RemoveTilesInRegion(const Region& layer_region, bool recreate_tiles); |
| 304 | 304 |
| 305 const size_t max_tiles_for_interest_area_; | 305 const float tiling_interest_area_viewport_multiplier_; |
| 306 const float skewport_target_time_in_seconds_; | 306 const float skewport_target_time_in_seconds_; |
| 307 const int skewport_extrapolation_limit_in_content_pixels_; | 307 const int skewport_extrapolation_limit_in_content_pixels_; |
| 308 | 308 |
| 309 // Given properties. | 309 // Given properties. |
| 310 const float contents_scale_; | 310 const float contents_scale_; |
| 311 PictureLayerTilingClient* const client_; | 311 PictureLayerTilingClient* const client_; |
| 312 const WhichTree tree_; | 312 const WhichTree tree_; |
| 313 scoped_refptr<RasterSource> raster_source_; | 313 scoped_refptr<RasterSource> raster_source_; |
| 314 TileResolution resolution_; | 314 TileResolution resolution_; |
| 315 | 315 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 340 | 340 |
| 341 private: | 341 private: |
| 342 DISALLOW_ASSIGN(PictureLayerTiling); | 342 DISALLOW_ASSIGN(PictureLayerTiling); |
| 343 | 343 |
| 344 RectExpansionCache expansion_cache_; | 344 RectExpansionCache expansion_cache_; |
| 345 }; | 345 }; |
| 346 | 346 |
| 347 } // namespace cc | 347 } // namespace cc |
| 348 | 348 |
| 349 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ | 349 #endif // CC_RESOURCES_PICTURE_LAYER_TILING_H_ |
| OLD | NEW |