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

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

Issue 2029323003: Don't skip a frame when running smooth scroll animation on the main thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove early out from addMainThreadScrollingReason Created 4 years, 6 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 OwnPtr<CompositorScrollOffsetAnimationCurve> m_animationCurve; 80 OwnPtr<CompositorScrollOffsetAnimationCurve> m_animationCurve;
81 double m_startTime; 81 double m_startTime;
82 WTF::TimeFunction m_timeFunction; 82 WTF::TimeFunction m_timeFunction;
83 83
84 private: 84 private:
85 // Returns true if the animation was scheduled successfully. If animation 85 // Returns true if the animation was scheduled successfully. If animation
86 // could not be scheduled (e.g. because the frame is detached), scrolls 86 // could not be scheduled (e.g. because the frame is detached), scrolls
87 // immediately to the target and returns false. 87 // immediately to the target and returns false.
88 bool registerAndScheduleAnimation(); 88 bool registerAndScheduleAnimation();
89 89
90 void createAnimationCurve();
90 void postAnimationCleanupAndReset(); 91 void postAnimationCleanupAndReset();
91 92
92 void addMainThreadScrollingReason(); 93 void addMainThreadScrollingReason();
93 void removeMainThreadScrollingReason(); 94 void removeMainThreadScrollingReason();
94 95
95 // Returns true if will animate to the given target position. Returns false 96 // Returns true if will animate to the given target position. Returns false
96 // only when there is no animation running and we are not starting one 97 // only when there is no animation running and we are not starting one
97 // because we are already at targetPos. 98 // because we are already at targetPos.
98 bool willAnimateToOffset(const FloatPoint& targetPos); 99 bool willAnimateToOffset(const FloatPoint& targetPos);
99 100
100 FloatPoint m_targetOffset; 101 FloatPoint m_targetOffset;
101 ScrollGranularity m_lastGranularity; 102 ScrollGranularity m_lastGranularity;
102 }; 103 };
103 104
104 } // namespace blink 105 } // namespace blink
105 106
106 #endif // ScrollAnimator_h 107 #endif // ScrollAnimator_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698