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

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

Issue 1420913008: CC AnimationHost: Fix ProgrammaticScrollAnimator detach scope. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 "config.h" 5 #include "config.h"
6 #include "platform/scroll/ProgrammaticScrollAnimator.h" 6 #include "platform/scroll/ProgrammaticScrollAnimator.h"
7 7
8 #include "platform/RuntimeEnabledFeatures.h" 8 #include "platform/RuntimeEnabledFeatures.h"
9 #include "platform/geometry/IntPoint.h" 9 #include "platform/geometry/IntPoint.h"
10 #include "platform/graphics/GraphicsLayer.h" 10 #include "platform/graphics/GraphicsLayer.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 void ProgrammaticScrollAnimator::reattachCompositorPlayerIfNeeded(WebCompositorA nimationTimeline* timeline) 209 void ProgrammaticScrollAnimator::reattachCompositorPlayerIfNeeded(WebCompositorA nimationTimeline* timeline)
210 { 210 {
211 int compositorAnimationAttachedToLayerId = 0; 211 int compositorAnimationAttachedToLayerId = 0;
212 if (m_scrollableArea->layerForScrolling()) 212 if (m_scrollableArea->layerForScrolling())
213 compositorAnimationAttachedToLayerId = m_scrollableArea->layerForScrolli ng()->platformLayer()->id(); 213 compositorAnimationAttachedToLayerId = m_scrollableArea->layerForScrolli ng()->platformLayer()->id();
214 214
215 if (compositorAnimationAttachedToLayerId != m_compositorAnimationAttachedToL ayerId) { 215 if (compositorAnimationAttachedToLayerId != m_compositorAnimationAttachedToL ayerId) {
216 if (m_compositorPlayer && timeline) { 216 if (m_compositorPlayer && timeline) {
217 // Detach from old layer (if any). 217 // Detach from old layer (if any).
218 if (m_compositorAnimationAttachedToLayerId) { 218 if (m_compositorAnimationAttachedToLayerId) {
219 ASSERT(m_compositorPlayer->isLayerAttached()); 219 if (m_compositorPlayer->isLayerAttached())
220 m_compositorPlayer->detachLayer(); 220 m_compositorPlayer->detachLayer();
221 timeline->playerDestroyed(*this); 221 timeline->playerDestroyed(*this);
222 } 222 }
223 // Attach to new layer (if any). 223 // Attach to new layer (if any).
224 if (compositorAnimationAttachedToLayerId) { 224 if (compositorAnimationAttachedToLayerId) {
225 ASSERT(m_scrollableArea->layerForScrolling()); 225 ASSERT(m_scrollableArea->layerForScrolling());
226 ASSERT(!m_compositorPlayer->isLayerAttached());
226 timeline->playerAttached(*this); 227 timeline->playerAttached(*this);
227 m_compositorPlayer->attachLayer(m_scrollableArea->layerForScroll ing()->platformLayer()); 228 m_compositorPlayer->attachLayer(m_scrollableArea->layerForScroll ing()->platformLayer());
228 } 229 }
229 m_compositorAnimationAttachedToLayerId = compositorAnimationAttached ToLayerId; 230 m_compositorAnimationAttachedToLayerId = compositorAnimationAttached ToLayerId;
230 } 231 }
231 } 232 }
232 } 233 }
233 234
234 void ProgrammaticScrollAnimator::layerForCompositedScrollingDidChange(WebComposi torAnimationTimeline* timeline) 235 void ProgrammaticScrollAnimator::layerForCompositedScrollingDidChange(WebComposi torAnimationTimeline* timeline)
235 { 236 {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 { 280 {
280 notifyCompositorAnimationFinished(group); 281 notifyCompositorAnimationFinished(group);
281 } 282 }
282 283
283 WebCompositorAnimationPlayer* ProgrammaticScrollAnimator::compositorPlayer() con st 284 WebCompositorAnimationPlayer* ProgrammaticScrollAnimator::compositorPlayer() con st
284 { 285 {
285 return m_compositorPlayer.get(); 286 return m_compositorPlayer.get();
286 } 287 }
287 288
288 } // namespace blink 289 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698