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

Side by Side Diff: sky/engine/core/animation/StringKeyframe.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_STRINGKEYFRAME_H_
6 #define SKY_ENGINE_CORE_ANIMATION_STRINGKEYFRAME_H_
7
8 #include "sky/engine/core/animation/Keyframe.h"
9 #include "sky/engine/core/css/StylePropertySet.h"
10
11 namespace blink {
12
13 class StyleSheetContents;
14
15 class StringKeyframe : public Keyframe {
16 public:
17 static PassRefPtr<StringKeyframe> create()
18 {
19 return adoptRef(new StringKeyframe);
20 }
21 void setPropertyValue(CSSPropertyID, const String& value, StyleSheetContents *);
22 void clearPropertyValue(CSSPropertyID property) { m_propertySet->removePrope rty(property); }
23 CSSValue* propertyValue(CSSPropertyID property) const
24 {
25 int index = m_propertySet->findPropertyIndex(property);
26 RELEASE_ASSERT(index >= 0);
27 return m_propertySet->propertyAt(static_cast<unsigned>(index)).value();
28 }
29 virtual PropertySet properties() const override;
30
31 class PropertySpecificKeyframe : public Keyframe::PropertySpecificKeyframe {
32 public:
33 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, CSSValue*, AnimationEffect::CompositeOperation);
34
35 CSSValue* value() const { return m_value.get(); }
36 virtual const PassRefPtr<AnimatableValue> getAnimatableValue() const ove rride final {
37 return m_animatableValueCache.get();
38 }
39
40 virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> neutralKeyframe(d ouble offset, PassRefPtr<TimingFunction> easing) const override final;
41 virtual PassRefPtr<Interpolation> createInterpolation(CSSPropertyID, bli nk::Keyframe::PropertySpecificKeyframe* end, Element*) const override final;
42
43 private:
44 PropertySpecificKeyframe(double offset, PassRefPtr<TimingFunction> easin g, CSSValue*);
45
46 virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> cloneWithOffset(d ouble offset) const;
47 virtual bool isStringPropertySpecificKeyframe() const override { return true; }
48
49 RefPtr<CSSValue> m_value;
50 mutable RefPtr<AnimatableValue> m_animatableValueCache;
51 };
52
53 private:
54 StringKeyframe()
55 : m_propertySet(MutableStylePropertySet::create())
56 { }
57
58 StringKeyframe(const StringKeyframe& copyFrom);
59
60 virtual PassRefPtr<Keyframe> clone() const override;
61 virtual PassOwnPtr<Keyframe::PropertySpecificKeyframe> createPropertySpecifi cKeyframe(CSSPropertyID) const override;
62
63 virtual bool isStringKeyframe() const override { return true; }
64
65 RefPtr<MutableStylePropertySet> m_propertySet;
66 };
67
68 typedef StringKeyframe::PropertySpecificKeyframe StringPropertySpecificKeyframe;
69
70 DEFINE_TYPE_CASTS(StringKeyframe, Keyframe, value, value->isStringKeyframe(), va lue.isStringKeyframe());
71 DEFINE_TYPE_CASTS(StringPropertySpecificKeyframe, Keyframe::PropertySpecificKeyf rame, value, value->isStringPropertySpecificKeyframe(), value.isStringPropertySp ecificKeyframe());
72
73 }
74
75 #endif // SKY_ENGINE_CORE_ANIMATION_STRINGKEYFRAME_H_
OLDNEW
« no previous file with comments | « sky/engine/core/animation/SampledEffect.cpp ('k') | sky/engine/core/animation/StringKeyframe.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698