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 "platform/scroll/ScrollAnimatorCompositorCoordinator.h" | 5 #include "platform/scroll/ScrollAnimatorCompositorCoordinator.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "cc/animation/scroll_offset_animation_curve.h" | 8 #include "cc/animation/scroll_offset_animation_curve.h" |
9 #include "platform/RuntimeEnabledFeatures.h" | 9 #include "platform/RuntimeEnabledFeatures.h" |
10 #include "platform/animation/CompositorAnimation.h" | 10 #include "platform/animation/CompositorAnimation.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 if (!hasImplOnlyAnimationUpdate()) | 254 if (!hasImplOnlyAnimationUpdate()) |
255 return; | 255 return; |
256 | 256 |
257 GraphicsLayer* layer = getScrollableArea()->layerForScrolling(); | 257 GraphicsLayer* layer = getScrollableArea()->layerForScrolling(); |
258 CompositorAnimationHost* host = | 258 CompositorAnimationHost* host = |
259 getScrollableArea()->compositorAnimationHost(); | 259 getScrollableArea()->compositorAnimationHost(); |
260 if (layer && host) { | 260 if (layer && host) { |
261 CompositorElementId elementId = layer->platformLayer()->elementId(); | 261 CompositorElementId elementId = layer->platformLayer()->elementId(); |
262 if (!m_implOnlyAnimationAdjustment.isZero()) { | 262 if (!m_implOnlyAnimationAdjustment.isZero()) { |
263 host->adjustImplOnlyScrollOffsetAnimation( | 263 host->adjustImplOnlyScrollOffsetAnimation( |
264 elementId, gfx::Vector2dF(m_implOnlyAnimationAdjustment.width(), | 264 elementId, |
265 m_implOnlyAnimationAdjustment.height())); | 265 gfx::Vector2dF(m_implOnlyAnimationAdjustment.width(), |
| 266 m_implOnlyAnimationAdjustment.height())); |
266 } | 267 } |
267 if (m_implOnlyAnimationTakeover) | 268 if (m_implOnlyAnimationTakeover) |
268 host->takeOverImplOnlyScrollOffsetAnimation(elementId); | 269 host->takeOverImplOnlyScrollOffsetAnimation(elementId); |
269 } | 270 } |
270 m_implOnlyAnimationAdjustment = IntSize(); | 271 m_implOnlyAnimationAdjustment = IntSize(); |
271 m_implOnlyAnimationTakeover = false; | 272 m_implOnlyAnimationTakeover = false; |
272 } | 273 } |
273 | 274 |
274 void ScrollAnimatorCompositorCoordinator::updateCompositorAnimations() { | 275 void ScrollAnimatorCompositorCoordinator::updateCompositorAnimations() { |
275 if (!getScrollableArea()->scrollAnimatorEnabled()) | 276 if (!getScrollableArea()->scrollAnimatorEnabled()) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 case RunState::WaitingToCancelOnCompositorButNewScroll: | 338 case RunState::WaitingToCancelOnCompositorButNewScroll: |
338 return String("WaitingToCancelOnCompositorButNewScroll"); | 339 return String("WaitingToCancelOnCompositorButNewScroll"); |
339 case RunState::RunningOnCompositorButNeedsAdjustment: | 340 case RunState::RunningOnCompositorButNeedsAdjustment: |
340 return String("RunningOnCompositorButNeedsAdjustment"); | 341 return String("RunningOnCompositorButNeedsAdjustment"); |
341 } | 342 } |
342 ASSERT_NOT_REACHED(); | 343 ASSERT_NOT_REACHED(); |
343 return String(); | 344 return String(); |
344 } | 345 } |
345 | 346 |
346 } // namespace blink | 347 } // namespace blink |
OLD | NEW |