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 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 | 25 |
26 ProgrammaticScrollAnimator::ProgrammaticScrollAnimator(ScrollableArea* scrollabl
eArea) | 26 ProgrammaticScrollAnimator::ProgrammaticScrollAnimator(ScrollableArea* scrollabl
eArea) |
27 : m_compositorAnimationAttachedToLayerId(0) | 27 : m_compositorAnimationAttachedToLayerId(0) |
28 , m_scrollableArea(scrollableArea) | 28 , m_scrollableArea(scrollableArea) |
29 , m_startTime(0.0) | 29 , m_startTime(0.0) |
30 , m_runState(RunState::Idle) | 30 , m_runState(RunState::Idle) |
31 , m_compositorAnimationId(0) | 31 , m_compositorAnimationId(0) |
32 , m_compositorAnimationGroupId(0) | 32 , m_compositorAnimationGroupId(0) |
33 { | 33 { |
34 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled()) { | 34 if (RuntimeEnabledFeatures::compositorAnimationTimelinesEnabled() && Platfor
m::current()->isThreadedAnimationEnabled()) { |
35 ASSERT(Platform::current()->compositorSupport()); | 35 ASSERT(Platform::current()->compositorSupport()); |
36 m_compositorPlayer = adoptPtr(Platform::current()->compositorSupport()->
createAnimationPlayer()); | 36 m_compositorPlayer = adoptPtr(Platform::current()->compositorSupport()->
createAnimationPlayer()); |
37 ASSERT(m_compositorPlayer); | 37 ASSERT(m_compositorPlayer); |
38 m_compositorPlayer->setAnimationDelegate(this); | 38 m_compositorPlayer->setAnimationDelegate(this); |
39 } | 39 } |
40 } | 40 } |
41 | 41 |
42 ProgrammaticScrollAnimator::~ProgrammaticScrollAnimator() | 42 ProgrammaticScrollAnimator::~ProgrammaticScrollAnimator() |
43 { | 43 { |
44 if (m_compositorPlayer) { | 44 if (m_compositorPlayer) { |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 { | 279 { |
280 notifyCompositorAnimationFinished(group); | 280 notifyCompositorAnimationFinished(group); |
281 } | 281 } |
282 | 282 |
283 WebCompositorAnimationPlayer* ProgrammaticScrollAnimator::compositorPlayer() con
st | 283 WebCompositorAnimationPlayer* ProgrammaticScrollAnimator::compositorPlayer() con
st |
284 { | 284 { |
285 return m_compositorPlayer.get(); | 285 return m_compositorPlayer.get(); |
286 } | 286 } |
287 | 287 |
288 } // namespace blink | 288 } // namespace blink |
OLD | NEW |