Chromium Code Reviews| Index: cc/tiles/picture_layer_tiling_set.h |
| diff --git a/cc/tiles/picture_layer_tiling_set.h b/cc/tiles/picture_layer_tiling_set.h |
| index 156f82c323a6b37f916c271ef58cb5d8018be0c9..dfa059265228416d67c1920dc6c4b98d346cfe97 100644 |
| --- a/cc/tiles/picture_layer_tiling_set.h |
| +++ b/cc/tiles/picture_layer_tiling_set.h |
| @@ -42,9 +42,9 @@ class CC_EXPORT PictureLayerTilingSet { |
| static std::unique_ptr<PictureLayerTilingSet> Create( |
| WhichTree tree, |
| PictureLayerTilingClient* client, |
| - size_t tiling_interest_area_padding, |
| + int tiling_interest_area_padding, |
| float skewport_target_time_in_seconds, |
| - int skewport_extrapolation_limit_in_content); |
| + int skewport_extrapolation_limit_in_screen_pixels); |
| ~PictureLayerTilingSet(); |
| @@ -115,6 +115,7 @@ class CC_EXPORT PictureLayerTilingSet { |
| void RemoveAllTiles(); |
| // Update the rects and priorities for tiles based on the given information. |
| + // Returns true if PrepareTiles is required. |
| bool UpdateTilePriorities(const gfx::Rect& required_rect_in_layer_space, |
| float ideal_contents_scale, |
| double current_frame_time_in_seconds, |
| @@ -172,13 +173,40 @@ class CC_EXPORT PictureLayerTilingSet { |
| TilingRange GetTilingRange(TilingRangeType type) const; |
| - private: |
| + protected: |
| + struct FrameVisibleRect { |
| + FrameVisibleRect(const gfx::Rect& rect, double time_in_seconds) |
| + : visible_rect_in_layer_space(rect), |
| + frame_time_in_seconds(time_in_seconds) {} |
| + |
| + gfx::Rect visible_rect_in_layer_space; |
| + double frame_time_in_seconds; |
| + }; |
| + |
| + struct StateSinceLastTilePriorityUpdate { |
| + class AutoClear { |
|
enne (OOO)
2016/05/03 23:03:01
I kinda think a state class with an autoclear subc
vmpstr
2016/05/03 23:31:59
Acknowledged.
|
| + public: |
| + explicit AutoClear(StateSinceLastTilePriorityUpdate* state_to_clear) |
| + : state_to_clear_(state_to_clear) {} |
| + ~AutoClear() { *state_to_clear_ = StateSinceLastTilePriorityUpdate(); } |
| + |
| + private: |
| + StateSinceLastTilePriorityUpdate* state_to_clear_; |
| + }; |
| + |
| + StateSinceLastTilePriorityUpdate() |
| + : invalidated(false), added_tilings(false) {} |
| + |
| + bool invalidated; |
| + bool added_tilings; |
| + }; |
| + |
| explicit PictureLayerTilingSet( |
| WhichTree tree, |
| PictureLayerTilingClient* client, |
| - size_t tiling_interest_area_padding, |
| + int tiling_interest_area_padding, |
| float skewport_target_time_in_seconds, |
| - int skewport_extrapolation_limit_in_content_pixels); |
| + int skewport_extrapolation_limit_in_screen_pixels); |
| void CopyTilingsAndPropertiesFromPendingTwin( |
| const PictureLayerTilingSet* pending_twin_set, |
| @@ -189,15 +217,39 @@ class CC_EXPORT PictureLayerTilingSet { |
| void Remove(PictureLayerTiling* tiling); |
| void VerifyTilings(const PictureLayerTilingSet* pending_twin_set) const; |
| + bool TilingsNeedUpdate(const gfx::Rect& required_rect_in_layer_space, |
| + double current_frame_time_in_Seconds); |
| + gfx::Rect ComputeSkewport(const gfx::Rect& visible_rect_in_layer_space, |
| + double current_frame_time_in_seconds, |
| + float ideal_contents_scale); |
| + gfx::Rect ComputeSoonBorderRect(const gfx::Rect& visible_rect_in_layer_space, |
| + float ideal_contents_scale); |
| + void UpdatePriorityRects(const gfx::Rect& visible_rect_in_layer_space, |
| + double current_frame_time_in_seconds, |
| + float ideal_contents_scale); |
| + |
| std::vector<std::unique_ptr<PictureLayerTiling>> tilings_; |
| - const size_t tiling_interest_area_padding_; |
| + const int tiling_interest_area_padding_; |
| const float skewport_target_time_in_seconds_; |
| - const int skewport_extrapolation_limit_in_content_pixels_; |
| + const int skewport_extrapolation_limit_in_screen_pixels_; |
| WhichTree tree_; |
| PictureLayerTilingClient* client_; |
| + // State saved for computing velocities based on finite differences. |
| + // .front() of the list refers to the most recent FrameVisibleRect. |
| + std::list<FrameVisibleRect> visible_rect_history_; |
| + StateSinceLastTilePriorityUpdate state_since_last_tile_priority_update_; |
| + |
| + scoped_refptr<RasterSource> raster_source_; |
| + |
| + gfx::Rect visible_rect_in_layer_space_; |
| + gfx::Rect skewport_in_layer_space_; |
| + gfx::Rect soon_border_rect_in_layer_space_; |
| + gfx::Rect eventually_rect_in_layer_space_; |
| friend class Iterator; |
| + |
| + private: |
| DISALLOW_COPY_AND_ASSIGN(PictureLayerTilingSet); |
| }; |