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

Unified Diff: sky/engine/core/animation/InterpolableValue.h

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/InertAnimation.cpp ('k') | sky/engine/core/animation/InterpolableValue.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/animation/InterpolableValue.h
diff --git a/sky/engine/core/animation/InterpolableValue.h b/sky/engine/core/animation/InterpolableValue.h
deleted file mode 100644
index 1fe0a103b6c5be1bd2d5d3034eb2168974213e2e..0000000000000000000000000000000000000000
--- a/sky/engine/core/animation/InterpolableValue.h
+++ /dev/null
@@ -1,157 +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.
-
-#ifndef SKY_ENGINE_CORE_ANIMATION_INTERPOLABLEVALUE_H_
-#define SKY_ENGINE_CORE_ANIMATION_INTERPOLABLEVALUE_H_
-
-#include "sky/engine/core/animation/animatable/AnimatableValue.h"
-#include "sky/engine/wtf/OwnPtr.h"
-#include "sky/engine/wtf/PassOwnPtr.h"
-#include "sky/engine/wtf/Vector.h"
-
-namespace blink {
-
-class InterpolableValue {
- DECLARE_EMPTY_VIRTUAL_DESTRUCTOR_WILL_BE_REMOVED(InterpolableValue);
-public:
- virtual bool isNumber() const { return false; }
- virtual bool isBool() const { return false; }
- virtual bool isList() const { return false; }
- virtual bool isAnimatableValue() const { return false; }
-
- virtual PassOwnPtr<InterpolableValue> clone() const = 0;
-
-private:
- virtual PassOwnPtr<InterpolableValue> interpolate(const InterpolableValue &to, const double progress) const = 0;
-
- friend class Interpolation;
-
- // Keep interpolate private, but allow calls within the hierarchy without
- // knowledge of type.
- friend class DeferredLegacyStyleInterpolation;
- friend class InterpolableNumber;
- friend class InterpolableBool;
- friend class InterpolableList;
-};
-
-class InterpolableNumber : public InterpolableValue {
-public:
- static PassOwnPtr<InterpolableNumber> create(double value)
- {
- return adoptPtr(new InterpolableNumber(value));
- }
-
- virtual bool isNumber() const override final { return true; }
- double value() const { return m_value; }
- virtual PassOwnPtr<InterpolableValue> clone() const override final { return create(m_value); }
-
-private:
- virtual PassOwnPtr<InterpolableValue> interpolate(const InterpolableValue &to, const double progress) const override final;
- double m_value;
-
- explicit InterpolableNumber(double value)
- : m_value(value)
- {
- }
-
-};
-
-class InterpolableBool : public InterpolableValue {
-public:
- static PassOwnPtr<InterpolableBool> create(bool value)
- {
- return adoptPtr(new InterpolableBool(value));
- }
-
- virtual bool isBool() const override final { return true; }
- bool value() const { return m_value; }
- virtual PassOwnPtr<InterpolableValue> clone() const override final { return create(m_value); }
-
-private:
- virtual PassOwnPtr<InterpolableValue> interpolate(const InterpolableValue &to, const double progress) const override final;
- bool m_value;
-
- explicit InterpolableBool(bool value)
- : m_value(value)
- {
- }
-
-};
-
-class InterpolableList : public InterpolableValue {
-public:
- static PassOwnPtr<InterpolableList> create(const InterpolableList &other)
- {
- return adoptPtr(new InterpolableList(other));
- }
-
- static PassOwnPtr<InterpolableList> create(size_t size)
- {
- return adoptPtr(new InterpolableList(size));
- }
-
- virtual bool isList() const override final { return true; }
- void set(size_t position, PassOwnPtr<InterpolableValue> value)
- {
- ASSERT(position < m_size);
- m_values[position] = value;
- }
- const InterpolableValue* get(size_t position) const
- {
- ASSERT(position < m_size);
- return m_values[position].get();
- }
- size_t length() const { return m_size; }
- virtual PassOwnPtr<InterpolableValue> clone() const override final { return create(*this); }
-
-private:
- virtual PassOwnPtr<InterpolableValue> interpolate(const InterpolableValue &other, const double progress) const override final;
- explicit InterpolableList(size_t size)
- : m_size(size)
- , m_values(m_size)
- {
- }
-
- InterpolableList(const InterpolableList& other)
- : m_size(other.m_size)
- , m_values(m_size)
- {
- for (size_t i = 0; i < m_size; i++)
- set(i, other.m_values[i]->clone());
- }
-
- size_t m_size;
- Vector<OwnPtr<InterpolableValue> > m_values;
-};
-
-// FIXME: Remove this when we can.
-class InterpolableAnimatableValue : public InterpolableValue {
-public:
- static PassOwnPtr<InterpolableAnimatableValue> create(PassRefPtr<AnimatableValue> value)
- {
- return adoptPtr(new InterpolableAnimatableValue(value));
- }
-
- virtual bool isAnimatableValue() const override final { return true; }
- AnimatableValue* value() const { return m_value.get(); }
- virtual PassOwnPtr<InterpolableValue> clone() const override final { return create(m_value); }
-
-private:
- virtual PassOwnPtr<InterpolableValue> interpolate(const InterpolableValue &other, const double progress) const override final;
- RefPtr<AnimatableValue> m_value;
-
- InterpolableAnimatableValue(PassRefPtr<AnimatableValue> value)
- : m_value(value)
- {
- }
-};
-
-DEFINE_TYPE_CASTS(InterpolableNumber, InterpolableValue, value, value->isNumber(), value.isNumber());
-DEFINE_TYPE_CASTS(InterpolableBool, InterpolableValue, value, value->isBool(), value.isBool());
-DEFINE_TYPE_CASTS(InterpolableList, InterpolableValue, value, value->isList(), value.isList());
-DEFINE_TYPE_CASTS(InterpolableAnimatableValue, InterpolableValue, value, value->isAnimatableValue(), value.isAnimatableValue());
-
-}
-
-#endif // SKY_ENGINE_CORE_ANIMATION_INTERPOLABLEVALUE_H_
« no previous file with comments | « sky/engine/core/animation/InertAnimation.cpp ('k') | sky/engine/core/animation/InterpolableValue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698