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

Unified Diff: sky/engine/core/animation/InterpolableValue.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/InterpolableValue.h ('k') | sky/engine/core/animation/InterpolableValueTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/animation/InterpolableValue.cpp
diff --git a/sky/engine/core/animation/InterpolableValue.cpp b/sky/engine/core/animation/InterpolableValue.cpp
deleted file mode 100644
index b1e3f1ee7723667292412492b607e963fed97efa..0000000000000000000000000000000000000000
--- a/sky/engine/core/animation/InterpolableValue.cpp
+++ /dev/null
@@ -1,60 +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/InterpolableValue.h"
-
-namespace blink {
-
-DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(InterpolableValue);
-
-PassOwnPtr<InterpolableValue> InterpolableNumber::interpolate(const InterpolableValue &to, const double progress) const
-{
- const InterpolableNumber& toNumber = toInterpolableNumber(to);
- if (!progress)
- return create(m_value);
- if (progress == 1)
- return create(toNumber.m_value);
- return create(m_value * (1 - progress) + toNumber.m_value * progress);
-}
-
-PassOwnPtr<InterpolableValue> InterpolableBool::interpolate(const InterpolableValue &to, const double progress) const
-{
- if (progress < 0.5) {
- return clone();
- }
- return to.clone();
-}
-
-PassOwnPtr<InterpolableValue> InterpolableList::interpolate(const InterpolableValue &to, const double progress) const
-{
- const InterpolableList& toList = toInterpolableList(to);
- ASSERT(toList.m_size == m_size);
-
- if (!progress) {
- return create(*this);
- }
- if (progress == 1) {
- return InterpolableList::create(toList);
- }
-
- OwnPtr<InterpolableList> result = create(m_size);
- for (size_t i = 0; i < m_size; i++) {
- ASSERT(m_values[i]);
- ASSERT(toList.m_values[i]);
- result->set(i, m_values[i]->interpolate(*(toList.m_values[i]), progress));
- }
- return result.release();
-}
-
-PassOwnPtr<InterpolableValue> InterpolableAnimatableValue::interpolate(const InterpolableValue &other, const double percentage) const
-{
- const InterpolableAnimatableValue& otherValue = toInterpolableAnimatableValue(other);
- if (!percentage)
- return create(m_value);
- if (percentage == 1)
- return create(otherValue.m_value);
- return create(AnimatableValue::interpolate(m_value.get(), otherValue.m_value.get(), percentage));
-}
-
-}
« no previous file with comments | « sky/engine/core/animation/InterpolableValue.h ('k') | sky/engine/core/animation/InterpolableValueTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698