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

Side by Side Diff: Source/core/animation/LengthStyleInterpolation.h

Issue 863863004: Implemented additive animations for length (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed AnimationStackTest Created 5 years, 10 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef LengthStyleInterpolation_h 5 #ifndef LengthStyleInterpolation_h
6 #define LengthStyleInterpolation_h 6 #define LengthStyleInterpolation_h
7 7
8 #include "core/animation/StyleInterpolation.h" 8 #include "core/animation/StyleInterpolation.h"
9 #include "core/css/CSSPrimitiveValue.h" 9 #include "core/css/CSSPrimitiveValue.h"
10 #include "platform/Length.h" 10 #include "platform/Length.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class LengthStyleInterpolation : public StyleInterpolation { 14 class LengthStyleInterpolation : public StyleInterpolation {
15 public: 15 public:
16 16
17 typedef void NonInterpolableType; 17 typedef void NonInterpolableType;
18 18
19 static PassRefPtrWillBeRawPtr<LengthStyleInterpolation> create(const CSSValu e& start, const CSSValue& end, CSSPropertyID id, InterpolationRange range) 19 static PassRefPtrWillBeRawPtr<LengthStyleInterpolation> create(const CSSValu e& start, const CSSValue& end, CSSPropertyID id, InterpolationRange range)
20 { 20 {
21 return adoptRefWillBeNoop(new LengthStyleInterpolation(toInterpolableVal ue(start), toInterpolableValue(end), id, range)); 21 return adoptRefWillBeNoop(new LengthStyleInterpolation(toInterpolableVal ue(start), toInterpolableValue(end), id, range));
22 } 22 }
23 23
24 static PassRefPtrWillBeRawPtr<LengthStyleInterpolation> create(const CSSValu e& start, const CSSValue& end, CSSPropertyID id, InterpolationRange range, Anima tionEffect::CompositeOperation compositeStart, AnimationEffect::CompositeOperati on compositeEnd)
25 {
26 return adoptRefWillBeNoop(new LengthStyleInterpolation(toInterpolableVal ue(start), toInterpolableValue(end), id, range, compositeStart, compositeEnd));
27 }
28
24 static bool canCreateFrom(const CSSValue&); 29 static bool canCreateFrom(const CSSValue&);
25 30
26 virtual void apply(StyleResolverState&) const override; 31 virtual void apply(StyleResolverState&) const override;
32 virtual void apply(StyleResolverState&, const InterpolableValue&) const over ride;
27 33
28 virtual void trace(Visitor*) override; 34 virtual void trace(Visitor*) override;
29 35
30 static PassOwnPtrWillBeRawPtr<InterpolableValue> toInterpolableValue(const C SSValue&); 36 static PassOwnPtrWillBeRawPtr<InterpolableValue> toInterpolableValue(const C SSValue&);
31 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> fromInterpolableValue(const InterpolableValue&, InterpolationRange); 37 static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> fromInterpolableValue(const InterpolableValue&, InterpolationRange);
32 38
33 private: 39 private:
34 LengthStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, Pa ssOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID id, InterpolationRan ge range) 40 LengthStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, Pa ssOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID id, InterpolationRan ge range)
35 : StyleInterpolation(start, end, id) 41 : StyleInterpolation(start, end, id)
36 , m_range(range) 42 , m_range(range)
37 { } 43 { }
38 44
45 LengthStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start, Pa ssOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID id, InterpolationRan ge range, AnimationEffect::CompositeOperation compositeStart, AnimationEffect::C ompositeOperation compositeEnd)
46 : StyleInterpolation(start, end, id, compositeStart, compositeEnd)
47 , m_range(range)
48 { }
49
39 InterpolationRange m_range; 50 InterpolationRange m_range;
40 }; 51 };
41 52
42 } 53 }
43 54
44 #endif 55 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698