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

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ProgrammaticScrollAnimator.h

Issue 1534813004: Run smooth scroll animations on the compositor when possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 ProgrammaticScrollAnimator_h 5 #ifndef ProgrammaticScrollAnimator_h
6 #define ProgrammaticScrollAnimator_h 6 #define ProgrammaticScrollAnimator_h
7 7
8 #include "platform/geometry/FloatPoint.h" 8 #include "platform/geometry/FloatPoint.h"
9 #include "platform/heap/Handle.h" 9 #include "platform/heap/Handle.h"
10 #include "platform/scroll/ScrollAnimatorCompositorCoordinator.h" 10 #include "platform/scroll/ScrollAnimatorCompositorCoordinator.h"
(...skipping 16 matching lines...) Expand all
27 public: 27 public:
28 static PassOwnPtrWillBeRawPtr<ProgrammaticScrollAnimator> create(ScrollableA rea*); 28 static PassOwnPtrWillBeRawPtr<ProgrammaticScrollAnimator> create(ScrollableA rea*);
29 29
30 virtual ~ProgrammaticScrollAnimator(); 30 virtual ~ProgrammaticScrollAnimator();
31 31
32 void scrollToOffsetWithoutAnimation(const FloatPoint&); 32 void scrollToOffsetWithoutAnimation(const FloatPoint&);
33 void animateToOffset(FloatPoint); 33 void animateToOffset(FloatPoint);
34 34
35 // ScrollAnimatorCompositorCoordinator implementation. 35 // ScrollAnimatorCompositorCoordinator implementation.
36 void resetAnimationState() override; 36 void resetAnimationState() override;
37 void cancelAnimation() override;
37 ScrollableArea* scrollableArea() const override { return m_scrollableArea; } 38 ScrollableArea* scrollableArea() const override { return m_scrollableArea; }
38 void tickAnimation(double monotonicTime) override; 39 void tickAnimation(double monotonicTime) override;
39 void updateCompositorAnimations() override; 40 void updateCompositorAnimations() override;
40 void notifyCompositorAnimationFinished(int groupId) override; 41 void notifyCompositorAnimationFinished(int groupId) override;
41 void layerForCompositedScrollingDidChange(WebCompositorAnimationTimeline*) o verride; 42 void layerForCompositedScrollingDidChange(WebCompositorAnimationTimeline*) o verride;
42 43
43 DECLARE_TRACE(); 44 DECLARE_TRACE();
44 45
45 private: 46 private:
46 explicit ProgrammaticScrollAnimator(ScrollableArea*); 47 explicit ProgrammaticScrollAnimator(ScrollableArea*);
47 48
48 void notifyPositionChanged(const DoublePoint&); 49 void notifyPositionChanged(const DoublePoint&);
49 50
50 RawPtrWillBeMember<ScrollableArea> m_scrollableArea; 51 RawPtrWillBeMember<ScrollableArea> m_scrollableArea;
51 OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve; 52 OwnPtr<WebScrollOffsetAnimationCurve> m_animationCurve;
52 FloatPoint m_targetOffset; 53 FloatPoint m_targetOffset;
53 double m_startTime; 54 double m_startTime;
54 }; 55 };
55 56
56 } // namespace blink 57 } // namespace blink
57 58
58 #endif // ProgrammaticScrollAnimator_h 59 #endif // ProgrammaticScrollAnimator_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698