OLD | NEW |
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 "wtf/Allocator.h" | 8 #include "wtf/Allocator.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class StyleResolverState; | 12 class StyleResolverState; |
| 13 class SVGPropertyBase; |
| 14 class SVGElement; |
13 | 15 |
14 class InterpolationEnvironment { | 16 class InterpolationEnvironment { |
15 STACK_ALLOCATED(); | 17 STACK_ALLOCATED(); |
16 public: | 18 public: |
17 explicit InterpolationEnvironment(StyleResolverState& state) | 19 explicit InterpolationEnvironment(StyleResolverState& state) |
18 : m_state(&state) | 20 : m_state(&state) |
| 21 , m_svgElement(nullptr) |
| 22 , m_svgBaseValue(nullptr) |
| 23 { } |
| 24 |
| 25 explicit InterpolationEnvironment(SVGElement& svgElement, const SVGPropertyB
ase& svgBaseValue) |
| 26 : m_state(nullptr) |
| 27 , m_svgElement(&svgElement) |
| 28 , m_svgBaseValue(&svgBaseValue) |
19 { } | 29 { } |
20 | 30 |
21 StyleResolverState& state() { ASSERT(m_state); return *m_state; } | 31 StyleResolverState& state() { ASSERT(m_state); return *m_state; } |
22 const StyleResolverState& state() const { ASSERT(m_state); return *m_state;
} | 32 const StyleResolverState& state() const { ASSERT(m_state); return *m_state;
} |
23 | 33 |
| 34 SVGElement& svgElement() { ASSERT(m_svgElement); return *m_svgElement; } |
| 35 const SVGElement& svgElement() const { ASSERT(m_svgElement); return *m_svgEl
ement; } |
| 36 |
| 37 const SVGPropertyBase& svgBaseValue() const { ASSERT(m_svgBaseValue); return
*m_svgBaseValue; } |
| 38 |
24 private: | 39 private: |
25 StyleResolverState* m_state; | 40 StyleResolverState* m_state; |
| 41 SVGElement* m_svgElement; |
| 42 const SVGPropertyBase* m_svgBaseValue; |
26 }; | 43 }; |
27 | 44 |
28 } // namespace blink | 45 } // namespace blink |
29 | 46 |
30 #endif // InterpolationEnvironment_h | 47 #endif // InterpolationEnvironment_h |
OLD | NEW |