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

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

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/SVGPathSegLinetoVerticalRel.h ('k') | Source/core/svg/SVGPathSegList.cpp » ('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) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 class SVGPathElement; 42 class SVGPathElement;
43 class SVGPathSegListTearOff; 43 class SVGPathSegListTearOff;
44 44
45 class SVGPathSegList : public SVGListPropertyHelper<SVGPathSegList, SVGPathSeg> { 45 class SVGPathSegList : public SVGListPropertyHelper<SVGPathSegList, SVGPathSeg> {
46 public: 46 public:
47 typedef void PrimitiveType; 47 typedef void PrimitiveType;
48 typedef SVGPathSeg ItemPropertyType; 48 typedef SVGPathSeg ItemPropertyType;
49 typedef SVGPathSegListTearOff TearOffType; 49 typedef SVGPathSegListTearOff TearOffType;
50 typedef SVGListPropertyHelper<SVGPathSegList, SVGPathSeg> Base; 50 typedef SVGListPropertyHelper<SVGPathSegList, SVGPathSeg> Base;
51 51
52 static PassRefPtr<SVGPathSegList> create(SVGPathElement* contextElement, SVG PathSegRole role = PathSegUndefinedRole) 52 static PassRefPtr<SVGPathSegList> create(SVGPathElement* contextElement)
53 { 53 {
54 return adoptRef(new SVGPathSegList(contextElement, role)); 54 return adoptRef(new SVGPathSegList(contextElement));
55 } 55 }
56 static PassRefPtr<SVGPathSegList> create() { ASSERT_NOT_REACHED(); return nu llptr; } 56 static PassRefPtr<SVGPathSegList> create() { ASSERT_NOT_REACHED(); return nu llptr; }
57 57
58 virtual ~SVGPathSegList(); 58 virtual ~SVGPathSegList();
59 59
60 const SVGPathByteStream* byteStream() const; 60 const SVGPathByteStream* byteStream() const;
61 void clearByteStream() { m_byteStream.clear(); } 61 void clearByteStream() { m_byteStream.clear(); }
62 62
63 // SVGListPropertyHelper methods with |m_byteStream| sync: 63 // SVGListPropertyHelper methods with |m_byteStream| sync:
64 64
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 virtual String valueAsString() const OVERRIDE; 136 virtual String valueAsString() const OVERRIDE;
137 void setValueAsString(const String&, ExceptionState&); 137 void setValueAsString(const String&, ExceptionState&);
138 138
139 virtual void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) OVERR IDE; 139 virtual void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) OVERR IDE;
140 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtr<SVGPropertyBase> fromValue, PassRefPtr<SVGPrope rtyBase> toValue, PassRefPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement *) OVERRIDE; 140 virtual void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned repeatCount, PassRefPtr<SVGPropertyBase> fromValue, PassRefPtr<SVGPrope rtyBase> toValue, PassRefPtr<SVGPropertyBase> toAtEndOfDurationValue, SVGElement *) OVERRIDE;
141 virtual float calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGElement*) OVERRIDE; 141 virtual float calculateDistance(PassRefPtr<SVGPropertyBase> to, SVGElement*) OVERRIDE;
142 142
143 static AnimatedPropertyType classType() { return AnimatedPath; } 143 static AnimatedPropertyType classType() { return AnimatedPath; }
144 144
145 private: 145 private:
146 SVGPathSegList(SVGPathElement*, SVGPathSegRole); 146 SVGPathSegList(SVGPathElement*);
147 SVGPathSegList(SVGPathElement*, SVGPathSegRole, PassOwnPtr<SVGPathByteStream >); 147 SVGPathSegList(SVGPathElement*, PassOwnPtr<SVGPathByteStream>);
148 148
149 friend class SVGPathSegListBuilder; 149 friend class SVGPathSegListBuilder;
150 // This is only to be called from SVGPathSegListBuilder. 150 // This is only to be called from SVGPathSegListBuilder.
151 void appendWithoutByteStreamSync(PassRefPtr<ItemPropertyType> passNewItem) 151 void appendWithoutByteStreamSync(PassRefPtr<ItemPropertyType> passNewItem)
152 { 152 {
153 Base::append(passNewItem); 153 Base::append(passNewItem);
154 } 154 }
155 155
156 void updateListFromByteStream(); 156 void updateListFromByteStream();
157 void invalidateList(); 157 void invalidateList();
158 158
159 // FIXME: This pointer should be removed after SVGPathSeg has a tear-off. 159 // FIXME: This pointer should be removed after SVGPathSeg has a tear-off.
160 // FIXME: oilpan: This is raw-ptr to avoid reference cycles. 160 // FIXME: oilpan: This is raw-ptr to avoid reference cycles.
161 // SVGPathSegList is either owned by SVGAnimatedPath or 161 // SVGPathSegList is either owned by SVGAnimatedPath or
162 // SVGPathSegListTearOff. Both keep |contextElement| alive, 162 // SVGPathSegListTearOff. Both keep |contextElement| alive,
163 // so this ptr is always valid. 163 // so this ptr is always valid.
164 SVGPathElement* m_contextElement; 164 SVGPathElement* m_contextElement;
165 165
166 SVGPathSegRole m_role;
167 mutable OwnPtr<SVGPathByteStream> m_byteStream; 166 mutable OwnPtr<SVGPathByteStream> m_byteStream;
168 bool m_listSyncedToByteStream; 167 bool m_listSyncedToByteStream;
169 }; 168 };
170 169
171 inline PassRefPtr<SVGPathSegList> toSVGPathSegList(PassRefPtr<SVGPropertyBase> p assBase) 170 inline PassRefPtr<SVGPathSegList> toSVGPathSegList(PassRefPtr<SVGPropertyBase> p assBase)
172 { 171 {
173 RefPtr<SVGPropertyBase> base = passBase; 172 RefPtr<SVGPropertyBase> base = passBase;
174 ASSERT(base->type() == SVGPathSegList::classType()); 173 ASSERT(base->type() == SVGPathSegList::classType());
175 return static_pointer_cast<SVGPathSegList>(base.release()); 174 return static_pointer_cast<SVGPathSegList>(base.release());
176 } 175 }
177 176
178 } // namespace blink 177 } // namespace blink
179 178
180 #endif 179 #endif
OLDNEW
« no previous file with comments | « Source/core/svg/SVGPathSegLinetoVerticalRel.h ('k') | Source/core/svg/SVGPathSegList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698