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

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

Issue 1734063003: Share animations from compositor to main thread. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make NotifyAnimationTakeover pure virtual Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2011, Google Inc. All rights reserved. 2 * Copyright (c) 2011, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 void cancelAnimation() override; 60 void cancelAnimation() override;
61 void resetAnimationState() override; 61 void resetAnimationState() override;
62 void updateCompositorAnimations() override; 62 void updateCompositorAnimations() override;
63 void notifyCompositorAnimationFinished(int groupId) override; 63 void notifyCompositorAnimationFinished(int groupId) override;
64 void notifyCompositorAnimationAborted(int groupId) override; 64 void notifyCompositorAnimationAborted(int groupId) override;
65 void layerForCompositedScrollingDidChange(CompositorAnimationTimeline*) over ride; 65 void layerForCompositedScrollingDidChange(CompositorAnimationTimeline*) over ride;
66 66
67 DECLARE_VIRTUAL_TRACE(); 67 DECLARE_VIRTUAL_TRACE();
68 68
69 protected: 69 protected:
70 void notifyAnimationTakeover(
71 double monotonicTime,
72 double animationStartTime,
73 scoped_ptr<cc::AnimationCurve>) override;
74
70 OwnPtr<CompositorScrollOffsetAnimationCurve> m_animationCurve; 75 OwnPtr<CompositorScrollOffsetAnimationCurve> m_animationCurve;
71 double m_startTime; 76 double m_startTime;
72 WTF::TimeFunction m_timeFunction; 77 WTF::TimeFunction m_timeFunction;
73 78
74 private: 79 private:
75 // Returns true if the animation was scheduled successfully. If animation 80 // Returns true if the animation was scheduled successfully. If animation
76 // could not be scheduled (e.g. because the frame is detached), scrolls 81 // could not be scheduled (e.g. because the frame is detached), scrolls
77 // immediately to the target and returns false. 82 // immediately to the target and returns false.
78 bool registerAndScheduleAnimation(); 83 bool registerAndScheduleAnimation();
79 84
80 void postAnimationCleanupAndReset(); 85 void postAnimationCleanupAndReset();
81 86
82 void addMainThreadScrollingReason(); 87 void addMainThreadScrollingReason();
83 void removeMainThreadScrollingReason(); 88 void removeMainThreadScrollingReason();
84 89
90 // Returns true if will animate to the given target position.
ajuma 2016/02/26 23:56:54 Please expand this to include the sorts of things
ymalik 2016/02/29 16:31:09 Done.
91 bool willAnimateToOffset(const FloatPoint& targetPos);
92
85 FloatPoint m_targetOffset; 93 FloatPoint m_targetOffset;
86 ScrollGranularity m_lastGranularity; 94 ScrollGranularity m_lastGranularity;
87 }; 95 };
88 96
89 } // namespace blink 97 } // namespace blink
90 98
91 #endif // ScrollAnimator_h 99 #endif // ScrollAnimator_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698