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

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

Issue 1248093002: Move interpolated Length unit types out of InterpolableValue into NonInterpolableValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 5 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 InterpolationValue_h 5 #ifndef InterpolationValue_h
6 #define InterpolationValue_h 6 #define InterpolationValue_h
7 7
8 #include "core/animation/InterpolableValue.h" 8 #include "core/animation/InterpolableValue.h"
9 #include "core/animation/NonInterpolableValue.h" 9 #include "core/animation/NonInterpolableValue.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
11 11
12 namespace blink { 12 namespace blink {
13 13
14 class InterpolationType; 14 class InterpolationType;
15 15
16 class InterpolationValue : public NoBaseWillBeGarbageCollectedFinalized<Interpol ationValue> { 16 class InterpolationValue : public NoBaseWillBeGarbageCollectedFinalized<Interpol ationValue> {
17 public: 17 public:
18 static PassOwnPtrWillBeRawPtr<InterpolationValue> create(const Interpolation Type& type, PassOwnPtrWillBeRawPtr<InterpolableValue> interpolableValue, PassRef PtrWillBeRawPtr<NonInterpolableValue> nonInterpolableValue = nullptr) 18 static PassOwnPtrWillBeRawPtr<InterpolationValue> create(const Interpolation Type& type, PassOwnPtrWillBeRawPtr<InterpolableValue> interpolableValue, PassRef PtrWillBeRawPtr<NonInterpolableValue> nonInterpolableValue = nullptr)
19 { 19 {
20 return adoptPtrWillBeNoop(new InterpolationValue(type, interpolableValue , nonInterpolableValue)); 20 return adoptPtrWillBeNoop(new InterpolationValue(type, interpolableValue , nonInterpolableValue));
21 } 21 }
22 22
23 PassOwnPtrWillBeRawPtr<InterpolationValue> clone() const 23 PassOwnPtrWillBeRawPtr<InterpolationValue> clone() const
24 { 24 {
25 return create(m_type, m_interpolableValue->clone(), m_nonInterpolableVal ue); 25 return create(m_type, m_interpolableValue->clone(), m_nonInterpolableVal ue);
26 } 26 }
27 27
28 const InterpolationType& type() const { return m_type; } 28 const InterpolationType& type() const { return m_type; }
29 const InterpolableValue& interpolableValue() const { return *m_interpolableV alue; } 29 const InterpolableValue& interpolableValue() const { return *m_interpolableV alue; }
30 const NonInterpolableValue* nonInterpolableValue() const { return m_nonInter polableValue.get(); }
31
30 InterpolableValue& interpolableValue() { return *m_interpolableValue; } 32 InterpolableValue& interpolableValue() { return *m_interpolableValue; }
31 const NonInterpolableValue* nonInterpolableValue() const { return m_nonInter polableValue.get(); } 33 void setNonInterpolableValue(PassRefPtrWillBeRawPtr<NonInterpolableValue> no nInterpolableValue) { m_nonInterpolableValue = nonInterpolableValue; }
32 34
33 DEFINE_INLINE_TRACE() 35 DEFINE_INLINE_TRACE()
34 { 36 {
35 visitor->trace(m_interpolableValue); 37 visitor->trace(m_interpolableValue);
36 visitor->trace(m_nonInterpolableValue); 38 visitor->trace(m_nonInterpolableValue);
37 } 39 }
38 40
39 private: 41 private:
40 InterpolationValue(const InterpolationType& type, PassOwnPtrWillBeRawPtr<Int erpolableValue> interpolableValue, PassRefPtrWillBeRawPtr<NonInterpolableValue> nonInterpolableValue = nullptr) 42 InterpolationValue(const InterpolationType& type, PassOwnPtrWillBeRawPtr<Int erpolableValue> interpolableValue, PassRefPtrWillBeRawPtr<NonInterpolableValue> nonInterpolableValue)
41 : m_type(type) 43 : m_type(type)
42 , m_interpolableValue(interpolableValue) 44 , m_interpolableValue(interpolableValue)
43 , m_nonInterpolableValue(nonInterpolableValue) 45 , m_nonInterpolableValue(nonInterpolableValue)
44 { 46 {
45 ASSERT(this->m_interpolableValue); 47 ASSERT(this->m_interpolableValue);
46 } 48 }
47 49
48 const InterpolationType& m_type; 50 const InterpolationType& m_type;
49 OwnPtrWillBeMember<InterpolableValue> m_interpolableValue; 51 OwnPtrWillBeMember<InterpolableValue> m_interpolableValue;
50 RefPtrWillBeMember<NonInterpolableValue> m_nonInterpolableValue; 52 RefPtrWillBeMember<NonInterpolableValue> m_nonInterpolableValue;
51 53
52 friend class InterpolationType; 54 friend class InterpolationType;
53 }; 55 };
54 56
55 } // namespace blink 57 } // namespace blink
56 58
57 #endif // InterpolationValue_h 59 #endif // InterpolationValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698