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

Side by Side Diff: third_party/WebKit/Source/core/animation/InterpolationEnvironment.h

Issue 2555923003: Make InvalidatableInterpolation's InterpolationTypes decided at effect application time (Closed)
Patch Set: lint Created 4 years 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 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 InterpolationEnvironment_h 5 #ifndef InterpolationEnvironment_h
6 #define InterpolationEnvironment_h 6 #define InterpolationEnvironment_h
7 7
8 #include "core/animation/InterpolationTypesMap.h"
8 #include "platform/heap/Handle.h" 9 #include "platform/heap/Handle.h"
9 #include "wtf/Allocator.h" 10 #include "wtf/Allocator.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 class StyleResolverState; 14 class StyleResolverState;
14 class SVGPropertyBase; 15 class SVGPropertyBase;
15 class SVGElement; 16 class SVGElement;
16 17
17 class InterpolationEnvironment { 18 class InterpolationEnvironment {
Eric Willigers 2016/12/07 22:49:49 Can we disallow copying?
alancutter (OOO until 2018) 2016/12/07 23:15:53 I think it's fine for this to be copied if it happ
18 STACK_ALLOCATED(); 19 STACK_ALLOCATED();
19 20
20 public: 21 public:
21 explicit InterpolationEnvironment(StyleResolverState& state) 22 explicit InterpolationEnvironment(const InterpolationTypesMap& map,
22 : m_state(&state), m_svgElement(nullptr), m_svgBaseValue(nullptr) {} 23 StyleResolverState& state)
24 : m_interpolationTypesMap(map),
25 m_state(&state),
26 m_svgElement(nullptr),
27 m_svgBaseValue(nullptr) {}
23 28
24 explicit InterpolationEnvironment(SVGElement& svgElement, 29 explicit InterpolationEnvironment(const InterpolationTypesMap& map,
30 SVGElement& svgElement,
25 const SVGPropertyBase& svgBaseValue) 31 const SVGPropertyBase& svgBaseValue)
26 : m_state(nullptr), 32 : m_interpolationTypesMap(map),
33 m_state(nullptr),
27 m_svgElement(&svgElement), 34 m_svgElement(&svgElement),
28 m_svgBaseValue(&svgBaseValue) {} 35 m_svgBaseValue(&svgBaseValue) {}
29 36
37 const InterpolationTypesMap& interpolationTypesMap() const {
38 return m_interpolationTypesMap;
39 }
40
30 StyleResolverState& state() { 41 StyleResolverState& state() {
31 DCHECK(m_state); 42 DCHECK(m_state);
32 return *m_state; 43 return *m_state;
33 } 44 }
34 const StyleResolverState& state() const { 45 const StyleResolverState& state() const {
35 DCHECK(m_state); 46 DCHECK(m_state);
36 return *m_state; 47 return *m_state;
37 } 48 }
38 49
39 SVGElement& svgElement() { 50 SVGElement& svgElement() {
40 DCHECK(m_svgElement); 51 DCHECK(m_svgElement);
41 return *m_svgElement; 52 return *m_svgElement;
42 } 53 }
43 const SVGElement& svgElement() const { 54 const SVGElement& svgElement() const {
44 DCHECK(m_svgElement); 55 DCHECK(m_svgElement);
45 return *m_svgElement; 56 return *m_svgElement;
46 } 57 }
47 58
48 const SVGPropertyBase& svgBaseValue() const { 59 const SVGPropertyBase& svgBaseValue() const {
49 DCHECK(m_svgBaseValue); 60 DCHECK(m_svgBaseValue);
50 return *m_svgBaseValue; 61 return *m_svgBaseValue;
51 } 62 }
52 63
53 private: 64 private:
65 const InterpolationTypesMap& m_interpolationTypesMap;
54 StyleResolverState* m_state; 66 StyleResolverState* m_state;
55 Member<SVGElement> m_svgElement; 67 Member<SVGElement> m_svgElement;
56 Member<const SVGPropertyBase> m_svgBaseValue; 68 Member<const SVGPropertyBase> m_svgBaseValue;
57 }; 69 };
58 70
59 } // namespace blink 71 } // namespace blink
60 72
61 #endif // InterpolationEnvironment_h 73 #endif // InterpolationEnvironment_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698