| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |