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

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

Issue 1153943003: Add foundation for removing AnimatableValues from StyleInterpolation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: PassOwnPtr Created 5 years, 6 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef AnimationValue_h
6 #define AnimationValue_h
7
8 #include "core/animation/InterpolableValue.h"
9 #include "core/animation/NonInterpolableValue.h"
10 #include "platform/heap/Handle.h"
11
12 namespace blink {
13
14 class AnimationType;
15
16 struct AnimationValue {
17 private:
18 DISALLOW_ALLOCATION();
19
20 public:
21 const AnimationType* type;
22 OwnPtrWillBeMember<InterpolableValue> interpolableValue;
23 RefPtrWillBeMember<NonInterpolableValue> nonInterpolableValue;
24
25 operator bool() const { return bool(type); }
26
27 AnimationValue()
28 : type(nullptr)
29 , interpolableValue(nullptr)
30 , nonInterpolableValue(nullptr)
31 { }
32
33 AnimationValue(const AnimationType* type, PassOwnPtrWillBeRawPtr<Interpolabl eValue> interpolableValue, RefPtrWillBeRawPtr<NonInterpolableValue> nonInterpola bleValue)
34 : type(type)
35 , interpolableValue(interpolableValue)
36 , nonInterpolableValue(nonInterpolableValue)
37 { }
38
39 void copy(const AnimationValue& other)
shans 2015/06/04 00:15:15 Should this not just be a copy constructor?
alancutter (OOO until 2018) 2015/06/11 04:15:13 This is used in "result.copy((fraction < 0.5) ? m_
40 {
41 type = other.type;
42 interpolableValue = other.interpolableValue ? other.interpolableValue->c lone() : nullptr;
43 nonInterpolableValue = other.nonInterpolableValue;
44 }
45
46 void clear()
47 {
48 type = nullptr;
49 interpolableValue = nullptr;
50 nonInterpolableValue = nullptr;
51 }
52
53 DEFINE_INLINE_TRACE()
54 {
55 visitor->trace(interpolableValue);
56 visitor->trace(nonInterpolableValue);
57 }
58 };
59
60 } // namespace blink
61
62 #endif // AnimationValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698