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

Unified Diff: cc/trees/layer_tree_host_impl.h

Issue 1866583002: Connect LTHI::ScrollAnimated to cc::Viewport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698