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

Side by Side Diff: Source/core/svg/SVGPathSegList.cpp

Issue 456763002: Get rid of SVGPathSegRole (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/core/svg/SVGPathSegList.h ('k') | Source/core/svg/SVGPathSegListBuilder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org> 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 19 matching lines...) Expand all
30 #include "core/svg/SVGPathByteStreamBuilder.h" 30 #include "core/svg/SVGPathByteStreamBuilder.h"
31 #include "core/svg/SVGPathByteStreamSource.h" 31 #include "core/svg/SVGPathByteStreamSource.h"
32 #include "core/svg/SVGPathElement.h" 32 #include "core/svg/SVGPathElement.h"
33 #include "core/svg/SVGPathParser.h" 33 #include "core/svg/SVGPathParser.h"
34 #include "core/svg/SVGPathSegListBuilder.h" 34 #include "core/svg/SVGPathSegListBuilder.h"
35 #include "core/svg/SVGPathSegListSource.h" 35 #include "core/svg/SVGPathSegListSource.h"
36 #include "core/svg/SVGPathUtilities.h" 36 #include "core/svg/SVGPathUtilities.h"
37 37
38 namespace blink { 38 namespace blink {
39 39
40 SVGPathSegList::SVGPathSegList(SVGPathElement* contextElement, SVGPathSegRole ro le) 40 SVGPathSegList::SVGPathSegList(SVGPathElement* contextElement)
41 : m_contextElement(contextElement) 41 : m_contextElement(contextElement)
42 , m_role(role)
43 , m_listSyncedToByteStream(true) 42 , m_listSyncedToByteStream(true)
44 { 43 {
45 ASSERT(contextElement); 44 ASSERT(contextElement);
46 } 45 }
47 46
48 SVGPathSegList::SVGPathSegList(SVGPathElement* contextElement, SVGPathSegRole ro le, PassOwnPtr<SVGPathByteStream> byteStream) 47 SVGPathSegList::SVGPathSegList(SVGPathElement* contextElement, PassOwnPtr<SVGPat hByteStream> byteStream)
49 : m_contextElement(contextElement) 48 : m_contextElement(contextElement)
50 , m_role(role)
51 , m_byteStream(byteStream) 49 , m_byteStream(byteStream)
52 , m_listSyncedToByteStream(true) 50 , m_listSyncedToByteStream(true)
53 { 51 {
54 ASSERT(contextElement); 52 ASSERT(contextElement);
55 } 53 }
56 54
57 SVGPathSegList::~SVGPathSegList() 55 SVGPathSegList::~SVGPathSegList()
58 { 56 {
59 } 57 }
60 58
61 PassRefPtr<SVGPathSegList> SVGPathSegList::clone() 59 PassRefPtr<SVGPathSegList> SVGPathSegList::clone()
62 { 60 {
63 RefPtr<SVGPathSegList> svgPathSegList = adoptRef(new SVGPathSegList(m_contex tElement, m_role, byteStream()->copy())); 61 RefPtr<SVGPathSegList> svgPathSegList = adoptRef(new SVGPathSegList(m_contex tElement, byteStream()->copy()));
64 svgPathSegList->invalidateList(); 62 svgPathSegList->invalidateList();
65 return svgPathSegList.release(); 63 return svgPathSegList.release();
66 } 64 }
67 65
68 PassRefPtr<SVGPropertyBase> SVGPathSegList::cloneForAnimation(const String& valu e) const 66 PassRefPtr<SVGPropertyBase> SVGPathSegList::cloneForAnimation(const String& valu e) const
69 { 67 {
70 RefPtr<SVGPathSegList> svgPathSegList = SVGPathSegList::create(m_contextElem ent); 68 RefPtr<SVGPathSegList> svgPathSegList = SVGPathSegList::create(m_contextElem ent);
71 svgPathSegList->setValueAsString(value, IGNORE_EXCEPTION); 69 svgPathSegList->setValueAsString(value, IGNORE_EXCEPTION);
72 return svgPathSegList; 70 return svgPathSegList;
73 } 71 }
(...skipping 23 matching lines...) Expand all
97 { 95 {
98 if (m_listSyncedToByteStream) 96 if (m_listSyncedToByteStream)
99 return; 97 return;
100 98
101 Base::clear(); 99 Base::clear();
102 100
103 if (m_byteStream && !m_byteStream->isEmpty()) { 101 if (m_byteStream && !m_byteStream->isEmpty()) {
104 SVGPathSegListBuilder builder; 102 SVGPathSegListBuilder builder;
105 builder.setCurrentSVGPathElement(m_contextElement); 103 builder.setCurrentSVGPathElement(m_contextElement);
106 builder.setCurrentSVGPathSegList(this); 104 builder.setCurrentSVGPathSegList(this);
107 builder.setCurrentSVGPathSegRole(PathSegUnalteredRole);
108 105
109 SVGPathByteStreamSource source(m_byteStream.get()); 106 SVGPathByteStreamSource source(m_byteStream.get());
110 107
111 SVGPathParser parser; 108 SVGPathParser parser;
112 parser.setCurrentConsumer(&builder); 109 parser.setCurrentConsumer(&builder);
113 parser.setCurrentSource(&source); 110 parser.setCurrentSource(&source);
114 parser.parsePathDataFromSource(UnalteredParsing); 111 parser.parsePathDataFromSource(UnalteredParsing);
115 } 112 }
116 113
117 m_listSyncedToByteStream = true; 114 m_listSyncedToByteStream = true;
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 } 227 }
231 } 228 }
232 229
233 float SVGPathSegList::calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGEleme nt*) 230 float SVGPathSegList::calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGEleme nt*)
234 { 231 {
235 // FIXME: Support paced animations. 232 // FIXME: Support paced animations.
236 return -1; 233 return -1;
237 } 234 }
238 235
239 } 236 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGPathSegList.h ('k') | Source/core/svg/SVGPathSegListBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698