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

Side by Side Diff: sky/engine/core/animation/animatable/AnimatableValueKeyframe.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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef SKY_ENGINE_CORE_ANIMATION_ANIMATABLE_ANIMATABLEVALUEKEYFRAME_H_
6 #define SKY_ENGINE_CORE_ANIMATION_ANIMATABLE_ANIMATABLEVALUEKEYFRAME_H_
7
8 #include "sky/engine/core/animation/Keyframe.h"
9 #include "sky/engine/core/animation/animatable/AnimatableValue.h"
10
11 namespace blink {
12
13 class AnimatableValueKeyframe : public Keyframe {
14 public:
15 static PassRefPtr<AnimatableValueKeyframe> create()
16 {
17 return adoptRef(new AnimatableValueKeyframe);
18 }
19 void setPropertyValue(CSSPropertyID property, PassRefPtr<AnimatableValue> va lue)
20 {
21 m_propertyValues.add(property, value);
22 }
23 void clearPropertyValue(CSSPropertyID property) { m_propertyValues.remove(pr operty); }
24 AnimatableValue* propertyValue(CSSPropertyID property) const
25 {
26 ASSERT(m_propertyValues.contains(property));
27 return m_propertyValues.get(property);
28 }
29 virtual PropertySet properties() const override;
30
31 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe {
32 public:
33 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, const AnimatableValue*, AnimationEffect::CompositeOperation);
34
35 AnimatableValue* value() const { return m_value.get(); }
36 virtual const PassRefPtr<AnimatableValue> getAnimatableValue() const ove rride final { return m_value; }
37
38 virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> neutralKeyframe(d ouble offset, PassRefPtr<TimingFunction> easing) const override final;
39 virtual PassRefPtr<Interpolation> createInterpolation(CSSPropertyID, bli nk::Keyframe::PropertySpecificKeyframe* end, Element*) const override final;
40
41 private:
42 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, PassRefPtr<AnimatableValue>);
43
44 virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> cloneWithOffset(d ouble offset) const override;
45 virtual bool isAnimatableValuePropertySpecificKeyframe() const override { return true; }
46
47 RefPtr<AnimatableValue> m_value;
48 };
49
50 private:
51 AnimatableValueKeyframe() { }
52
53 AnimatableValueKeyframe(const AnimatableValueKeyframe& copyFrom);
54
55 virtual PassRefPtr<Keyframe> clone() const override;
56 virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> createPropertySpecifi cKeyframe(CSSPropertyID) const override;
57
58 virtual bool isAnimatableValueKeyframe() const override { return true; }
59
60 typedef HashMap<CSSPropertyID, RefPtr<AnimatableValue> > PropertyValueMap;
61 PropertyValueMap m_propertyValues;
62 };
63
64 typedef AnimatableValueKeyframe::PropertySpecificKeyframe AnimatableValuePropert ySpecificKeyframe;
65
66 DEFINE_TYPE_CASTS(AnimatableValueKeyframe, Keyframe, value, value->isAnimatableV alueKeyframe(), value.isAnimatableValueKeyframe());
67 DEFINE_TYPE_CASTS(AnimatableValuePropertySpecificKeyframe, Keyframe::PropertySpe cificKeyframe, value, value->isAnimatableValuePropertySpecificKeyframe(), value. isAnimatableValuePropertySpecificKeyframe());
68
69 }
70
71 #endif // SKY_ENGINE_CORE_ANIMATION_ANIMATABLE_ANIMATABLEVALUEKEYFRAME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698