OLD | NEW |
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 #include "core/css/CSSPathValue.h" | 5 #include "core/css/CSSPathValue.h" |
6 | 6 |
7 #include "core/style/StylePath.h" | 7 #include "core/style/StylePath.h" |
8 #include "core/svg/SVGPathUtilities.h" | 8 #include "core/svg/SVGPathUtilities.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 } | 45 } |
46 | 46 |
47 } // namespace | 47 } // namespace |
48 | 48 |
49 CSSPathValue* CSSPathValue::emptyPathValue() | 49 CSSPathValue* CSSPathValue::emptyPathValue() |
50 { | 50 { |
51 DEFINE_STATIC_LOCAL(RefPtrWillBePersistent<CSSPathValue>, empty, (createPath
Value())); | 51 DEFINE_STATIC_LOCAL(RefPtrWillBePersistent<CSSPathValue>, empty, (createPath
Value())); |
52 return empty.get(); | 52 return empty.get(); |
53 } | 53 } |
54 | 54 |
55 StylePath* CSSPathValue::cachedPath() | 55 StylePath* CSSPathValue::cachedPath() const |
56 { | 56 { |
57 if (!m_cachedPath) | 57 if (!m_cachedPath) |
58 m_cachedPath = StylePath::create(m_pathByteStream); | 58 m_cachedPath = StylePath::create(m_pathByteStream); |
59 return m_cachedPath.get(); | 59 return m_cachedPath.get(); |
60 } | 60 } |
61 | 61 |
62 String CSSPathValue::customCSSText() const | 62 String CSSPathValue::customCSSText() const |
63 { | 63 { |
64 return "path('" + pathString() + "')"; | 64 return "path('" + pathString() + "')"; |
65 } | 65 } |
66 | 66 |
67 bool CSSPathValue::equals(const CSSPathValue& other) const | 67 bool CSSPathValue::equals(const CSSPathValue& other) const |
68 { | 68 { |
69 return *m_pathByteStream == *other.m_pathByteStream; | 69 return *m_pathByteStream == *other.m_pathByteStream; |
70 } | 70 } |
71 | 71 |
72 DEFINE_TRACE_AFTER_DISPATCH(CSSPathValue) | 72 DEFINE_TRACE_AFTER_DISPATCH(CSSPathValue) |
73 { | 73 { |
74 CSSValue::traceAfterDispatch(visitor); | 74 CSSValue::traceAfterDispatch(visitor); |
75 } | 75 } |
76 | 76 |
77 String CSSPathValue::pathString() const | 77 String CSSPathValue::pathString() const |
78 { | 78 { |
79 return buildStringFromByteStream(*m_pathByteStream); | 79 return buildStringFromByteStream(*m_pathByteStream); |
80 } | 80 } |
81 | 81 |
82 } // namespace blink | 82 } // namespace blink |
OLD | NEW |