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

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

Issue 1801753002: First programmatic smooth scroll should run on the compositor if it can (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bot compile error Created 4 years, 9 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 // 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 #include "platform/scroll/ProgrammaticScrollAnimator.h" 5 #include "platform/scroll/ProgrammaticScrollAnimator.h"
6 6
7 #include "platform/animation/CompositorAnimation.h" 7 #include "platform/animation/CompositorAnimation.h"
8 #include "platform/animation/CompositorScrollOffsetAnimationCurve.h" 8 #include "platform/animation/CompositorScrollOffsetAnimationCurve.h"
9 #include "platform/geometry/IntPoint.h" 9 #include "platform/geometry/IntPoint.h"
10 #include "platform/graphics/CompositorFactory.h" 10 #include "platform/graphics/CompositorFactory.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 m_compositorAnimationId = 0; 115 m_compositorAnimationId = 0;
116 m_compositorAnimationGroupId = 0; 116 m_compositorAnimationGroupId = 0;
117 if (m_runState == RunState::WaitingToCancelOnCompositor) { 117 if (m_runState == RunState::WaitingToCancelOnCompositor) {
118 resetAnimationState(); 118 resetAnimationState();
119 return; 119 return;
120 } 120 }
121 } 121 }
122 122
123 if (m_runState == RunState::WaitingToSendToCompositor) { 123 if (m_runState == RunState::WaitingToSendToCompositor) {
124 if (!m_compositorAnimationAttachedToLayerId)
125 reattachCompositorPlayerIfNeeded(getScrollableArea()->compositorAnim ationTimeline());
126
124 bool sentToCompositor = false; 127 bool sentToCompositor = false;
125 128
126 if (!m_scrollableArea->shouldScrollOnMainThread()) { 129 if (!m_scrollableArea->shouldScrollOnMainThread()) {
127 OwnPtr<CompositorAnimation> animation = adoptPtr(CompositorFactory:: current().createAnimation(*m_animationCurve, CompositorTargetProperty::SCROLL_OF FSET)); 130 OwnPtr<CompositorAnimation> animation = adoptPtr(CompositorFactory:: current().createAnimation(*m_animationCurve, CompositorTargetProperty::SCROLL_OF FSET));
128 131
129 int animationId = animation->id(); 132 int animationId = animation->id();
130 int animationGroupId = animation->group(); 133 int animationGroupId = animation->group();
131 134
132 if (addAnimation(animation.release())) { 135 if (addAnimation(animation.release())) {
133 sentToCompositor = true; 136 sentToCompositor = true;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 ScrollAnimatorCompositorCoordinator::compositorAnimationFinished(groupId); 178 ScrollAnimatorCompositorCoordinator::compositorAnimationFinished(groupId);
176 } 179 }
177 180
178 DEFINE_TRACE(ProgrammaticScrollAnimator) 181 DEFINE_TRACE(ProgrammaticScrollAnimator)
179 { 182 {
180 visitor->trace(m_scrollableArea); 183 visitor->trace(m_scrollableArea);
181 ScrollAnimatorCompositorCoordinator::trace(visitor); 184 ScrollAnimatorCompositorCoordinator::trace(visitor);
182 } 185 }
183 186
184 } // namespace blink 187 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/testing/Internals.idl ('k') | third_party/WebKit/Source/platform/scroll/ScrollAnimator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698