OLD | NEW |
(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 #include "core/style/StylePath.h" |
| 6 |
| 7 #include "core/css/CSSPathValue.h" |
| 8 #include "core/svg/SVGPathByteStream.h" |
| 9 #include "core/svg/SVGPathUtilities.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 StylePath::StylePath(PassRefPtr<SVGPathByteStream> pathByteStream) |
| 14 : m_byteStream(pathByteStream) |
| 15 { |
| 16 ASSERT(m_byteStream); |
| 17 buildPathFromByteStream(*m_byteStream, m_path); |
| 18 } |
| 19 |
| 20 StylePath::~StylePath() |
| 21 { |
| 22 } |
| 23 |
| 24 PassRefPtr<StylePath> StylePath::create(PassRefPtr<SVGPathByteStream> pathByteSt
ream) |
| 25 { |
| 26 return adoptRef(new StylePath(pathByteStream)); |
| 27 } |
| 28 |
| 29 StylePath* StylePath::emptyPath() |
| 30 { |
| 31 DEFINE_STATIC_REF(StylePath, emptyPath, StylePath::create(SVGPathByteStream:
:create())); |
| 32 return emptyPath; |
| 33 } |
| 34 |
| 35 const SVGPathByteStream& StylePath::byteStream() const |
| 36 { |
| 37 return *m_byteStream; |
| 38 } |
| 39 |
| 40 PassRefPtrWillBeRawPtr<CSSValue> StylePath::computedCSSValue() const |
| 41 { |
| 42 return CSSPathValue::create(m_byteStream, const_cast<StylePath*>(this)); |
| 43 } |
| 44 |
| 45 bool StylePath::equals(const StylePath& other) const |
| 46 { |
| 47 return *m_byteStream == *other.m_byteStream; |
| 48 } |
| 49 |
| 50 } // namespace blink |
OLD | NEW |