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

Unified Diff: sky/engine/core/animation/Interpolation.cpp

Issue 1229273004: Remove Animations and Transitions. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 months 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
« no previous file with comments | « sky/engine/core/animation/Interpolation.h ('k') | sky/engine/core/animation/InterpolationEffect.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/animation/Interpolation.cpp
diff --git a/sky/engine/core/animation/Interpolation.cpp b/sky/engine/core/animation/Interpolation.cpp
deleted file mode 100644
index 931ddbc368ede678850d39930602073dcc75b335..0000000000000000000000000000000000000000
--- a/sky/engine/core/animation/Interpolation.cpp
+++ /dev/null
@@ -1,55 +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 "sky/engine/core/animation/Interpolation.h"
-
-namespace blink {
-
-DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Interpolation);
-
-namespace {
-
-bool typesMatch(const InterpolableValue* start, const InterpolableValue* end)
-{
- if (start->isNumber())
- return end->isNumber();
- if (start->isBool())
- return end->isBool();
- if (start->isAnimatableValue())
- return end->isAnimatableValue();
- if (!(start->isList() && end->isList()))
- return false;
- const InterpolableList* startList = toInterpolableList(start);
- const InterpolableList* endList = toInterpolableList(end);
- if (startList->length() != endList->length())
- return false;
- for (size_t i = 0; i < startList->length(); ++i) {
- if (!typesMatch(startList->get(i), endList->get(i)))
- return false;
- }
- return true;
-}
-
-}
-
-Interpolation::Interpolation(PassOwnPtr<InterpolableValue> start, PassOwnPtr<InterpolableValue> end)
- : m_start(start)
- , m_end(end)
- , m_cachedFraction(0)
- , m_cachedIteration(0)
- , m_cachedValue(m_start->clone())
-{
- RELEASE_ASSERT(typesMatch(m_start.get(), m_end.get()));
-}
-
-void Interpolation::interpolate(int iteration, double fraction) const
-{
- if (m_cachedFraction != fraction || m_cachedIteration != iteration) {
- m_cachedValue = m_start->interpolate(*m_end, fraction);
- m_cachedIteration = iteration;
- m_cachedFraction = fraction;
- }
-}
-
-}
« no previous file with comments | « sky/engine/core/animation/Interpolation.h ('k') | sky/engine/core/animation/InterpolationEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698