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

Side by Side Diff: third_party/WebKit/Source/core/style/StylePath.cpp

Issue 1545713003: Add StylePath and use it to store 'd' in ComputedStyle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015->2016; Remove unnecessary explicit. Created 4 years, 11 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
OLDNEW
(Empty)
1 // Copyright 2016 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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/style/StylePath.h ('k') | third_party/WebKit/Source/core/svg/SVGPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698