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

Unified Diff: sky/engine/platform/scroll/ProgrammaticScrollAnimator.cpp

Issue 720713003: Remove WebScroll* (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: sky/engine/platform/scroll/ProgrammaticScrollAnimator.cpp
diff --git a/sky/engine/platform/scroll/ProgrammaticScrollAnimator.cpp b/sky/engine/platform/scroll/ProgrammaticScrollAnimator.cpp
deleted file mode 100644
index e7478adb5354ce82d92283c733f71a0793103d19..0000000000000000000000000000000000000000
--- a/sky/engine/platform/scroll/ProgrammaticScrollAnimator.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "platform/scroll/ProgrammaticScrollAnimator.h"
-
-#include "platform/geometry/IntPoint.h"
-#include "platform/scroll/ScrollableArea.h"
-#include "public/platform/Platform.h"
-#include "public/platform/WebCompositorSupport.h"
-#include "public/platform/WebScrollOffsetAnimationCurve.h"
-
-namespace blink {
-
-PassOwnPtr<ProgrammaticScrollAnimator> ProgrammaticScrollAnimator::create(ScrollableArea* scrollableArea)
-{
- return adoptPtr(new ProgrammaticScrollAnimator(scrollableArea));
-}
-
-ProgrammaticScrollAnimator::ProgrammaticScrollAnimator(ScrollableArea* scrollableArea)
- : m_scrollableArea(scrollableArea)
- , m_startTime(0.0)
-{
-}
-
-ProgrammaticScrollAnimator::~ProgrammaticScrollAnimator()
-{
-}
-
-void ProgrammaticScrollAnimator::resetAnimationState()
-{
- m_animationCurve.clear();
- m_startTime = 0.0;
-}
-
-void ProgrammaticScrollAnimator::animateToOffset(FloatPoint offset)
-{
- m_startTime = 0.0;
- m_targetOffset = offset;
- m_animationCurve = adoptPtr(Platform::current()->compositorSupport()->createScrollOffsetAnimationCurve(m_targetOffset, WebCompositorAnimationCurve::TimingFunctionTypeEaseInOut));
-
- m_animationCurve->setInitialValue(FloatPoint(m_scrollableArea->scrollPosition()));
- if (!m_scrollableArea->scheduleAnimation()) {
- resetAnimationState();
- m_scrollableArea->notifyScrollPositionChanged(IntPoint(offset.x(), offset.y()));
- }
-}
-
-void ProgrammaticScrollAnimator::cancelAnimation()
-{
- resetAnimationState();
-}
-
-void ProgrammaticScrollAnimator::tickAnimation(double monotonicTime)
-{
- if (m_animationCurve) {
- if (!m_startTime)
- m_startTime = monotonicTime;
- double elapsedTime = monotonicTime - m_startTime;
- bool isFinished = (elapsedTime > m_animationCurve->duration());
- FloatPoint offset = m_animationCurve->getValue(elapsedTime);
- m_scrollableArea->notifyScrollPositionChanged(IntPoint(offset.x(), offset.y()));
-
- if (isFinished) {
- resetAnimationState();
- } else if (!m_scrollableArea->scheduleAnimation()) {
- m_scrollableArea->notifyScrollPositionChanged(IntPoint(m_targetOffset.x(), m_targetOffset.y()));
- resetAnimationState();
- }
- }
-}
-
-} // namespace blink
« no previous file with comments | « sky/engine/platform/scroll/ProgrammaticScrollAnimator.h ('k') | sky/engine/platform/scroll/ScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698