Index: cc/trees/layer_tree_host_impl.h |
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h |
index a7d6b083235eca111337803d8af04cf9f367e3e1..dbdee2ce1d60e4c87e8a8c5eed67a9f2ddcc1486 100644 |
--- a/cc/trees/layer_tree_host_impl.h |
+++ b/cc/trees/layer_tree_host_impl.h |
@@ -536,6 +536,18 @@ class CC_EXPORT LayerTreeHostImpl |
bool opaque; |
}; |
+ struct ScrollAmount { |
bokan
2016/04/06 13:35:52
I don't like this, there's opportunity for delta a
ymalik
2016/04/06 15:33:45
You're right, it's not used often enough to justif
|
+ ScrollAmount(gfx::Vector2dF delta, gfx::ScrollOffset offset) |
+ : delta(delta), target_offset(offset) {} |
+ gfx::Vector2dF delta; |
+ gfx::ScrollOffset target_offset; |
+ }; |
+ |
+ // Returns the amount of delta that can be applied to scroll_node, taking |
+ // page scale into account. |
+ ScrollAmount ComputeScrollDelta(ScrollNode* scroll_node, |
+ const gfx::Vector2dF& delta); |
+ |
void ScheduleMicroBenchmark(scoped_ptr<MicroBenchmarkImpl> benchmark); |
CompositorFrameMetadata MakeCompositorFrameMetadata() const; |
@@ -616,6 +628,11 @@ class CC_EXPORT LayerTreeHostImpl |
const ScrollTree& scroll_tree, |
ScrollNode* scroll_node) const; |
+ // Returns true if a scroll offset animation is created and false if we scroll |
+ // by the desired amount without an animation. |
+ bool ScrollAnimationCreate(ScrollNode* scroll_node, |
+ const ScrollAmount& scroll_amount); |
+ |
protected: |
LayerTreeHostImpl( |
const LayerTreeSettings& settings, |
@@ -714,9 +731,6 @@ class CC_EXPORT LayerTreeHostImpl |
void ScrollAnimationAbort(LayerImpl* layer_impl); |
- void ScrollAnimationCreate(ScrollNode* scroll_node, |
- const gfx::ScrollOffset& target_offset, |
- const gfx::ScrollOffset& current_offset); |
bool ScrollAnimationUpdateTarget(ScrollNode* scroll_node, |
const gfx::Vector2dF& scroll_delta); |