OLD | NEW |
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 return adoptRefWillBeNoop(new SVGPathSegList(contextElement)); | 53 return adoptRefWillBeNoop(new SVGPathSegList(contextElement)); |
54 } | 54 } |
55 static PassRefPtrWillBeRawPtr<SVGPathSegList> create() | 55 static PassRefPtrWillBeRawPtr<SVGPathSegList> create() |
56 { | 56 { |
57 ASSERT_NOT_REACHED(); | 57 ASSERT_NOT_REACHED(); |
58 return nullptr; | 58 return nullptr; |
59 } | 59 } |
60 | 60 |
61 ~SVGPathSegList() override; | 61 ~SVGPathSegList() override; |
62 | 62 |
63 const SVGPathByteStream* byteStream() const; | 63 const SVGPathByteStream& byteStream() const; |
| 64 SVGPathByteStream& mutableByteStream(); |
64 void clearByteStream() { m_byteStream.clear(); } | 65 void clearByteStream() { m_byteStream.clear(); } |
65 | 66 |
66 // SVGListPropertyHelper methods with |m_byteStream| sync: | 67 // SVGListPropertyHelper methods with |m_byteStream| sync: |
67 | 68 |
68 ItemPropertyType* at(size_t index) | 69 ItemPropertyType* at(size_t index) |
69 { | 70 { |
70 updateListFromByteStream(); | 71 updateListFromByteStream(); |
71 return Base::at(index); | 72 return Base::at(index); |
72 } | 73 } |
73 | 74 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 void setValueAsString(const String&, ExceptionState&); | 141 void setValueAsString(const String&, ExceptionState&); |
141 | 142 |
142 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; | 143 void add(PassRefPtrWillBeRawPtr<SVGPropertyBase>, SVGElement*) override; |
143 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> fromValue, PassRefPtrWillB
eRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEn
dOfDurationValue, SVGElement*) override; | 144 void calculateAnimatedValue(SVGAnimationElement*, float percentage, unsigned
repeatCount, PassRefPtrWillBeRawPtr<SVGPropertyBase> fromValue, PassRefPtrWillB
eRawPtr<SVGPropertyBase> toValue, PassRefPtrWillBeRawPtr<SVGPropertyBase> toAtEn
dOfDurationValue, SVGElement*) override; |
144 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt*) override; | 145 float calculateDistance(PassRefPtrWillBeRawPtr<SVGPropertyBase> to, SVGEleme
nt*) override; |
145 | 146 |
146 static AnimatedPropertyType classType() { return AnimatedPath; } | 147 static AnimatedPropertyType classType() { return AnimatedPath; } |
147 | 148 |
148 DECLARE_VIRTUAL_TRACE(); | 149 DECLARE_VIRTUAL_TRACE(); |
149 | 150 |
| 151 void invalidateList(); |
| 152 |
150 private: | 153 private: |
151 explicit SVGPathSegList(SVGPathElement*); | 154 explicit SVGPathSegList(SVGPathElement*); |
152 SVGPathSegList(SVGPathElement*, PassOwnPtr<SVGPathByteStream>); | 155 SVGPathSegList(SVGPathElement*, PassOwnPtr<SVGPathByteStream>); |
153 | 156 |
154 friend class SVGPathSegListBuilder; | 157 friend class SVGPathSegListBuilder; |
155 // This is only to be called from SVGPathSegListBuilder. | 158 // This is only to be called from SVGPathSegListBuilder. |
156 void appendWithoutByteStreamSync(PassRefPtrWillBeRawPtr<ItemPropertyType> pa
ssNewItem) | 159 void appendWithoutByteStreamSync(PassRefPtrWillBeRawPtr<ItemPropertyType> pa
ssNewItem) |
157 { | 160 { |
158 Base::append(passNewItem); | 161 Base::append(passNewItem); |
159 } | 162 } |
160 | 163 |
161 void updateListFromByteStream(); | 164 void updateListFromByteStream(); |
162 void invalidateList(); | |
163 | 165 |
164 // FIXME: This pointer should be removed after SVGPathSeg has a tear-off. | 166 // FIXME: This pointer should be removed after SVGPathSeg has a tear-off. |
165 // | 167 // |
166 // SVGPathSegList is either owned by SVGAnimatedPath or SVGPathSegListTearOf
f. | 168 // SVGPathSegList is either owned by SVGAnimatedPath or SVGPathSegListTearOf
f. |
167 // Both keep |contextElement| alive, so this ptr is always valid. | 169 // Both keep |contextElement| alive, so this ptr is always valid. |
168 GC_PLUGIN_IGNORE("528275") | 170 GC_PLUGIN_IGNORE("528275") |
169 SVGPathElement* m_contextElement; | 171 SVGPathElement* m_contextElement; |
170 | 172 |
171 mutable OwnPtr<SVGPathByteStream> m_byteStream; | 173 mutable OwnPtr<SVGPathByteStream> m_byteStream; |
172 bool m_listSyncedToByteStream; | 174 bool m_listSyncedToByteStream; |
173 }; | 175 }; |
174 | 176 |
175 inline PassRefPtrWillBeRawPtr<SVGPathSegList> toSVGPathSegList(PassRefPtrWillBeR
awPtr<SVGPropertyBase> passBase) | 177 inline PassRefPtrWillBeRawPtr<SVGPathSegList> toSVGPathSegList(PassRefPtrWillBeR
awPtr<SVGPropertyBase> passBase) |
176 { | 178 { |
177 RefPtrWillBeRawPtr<SVGPropertyBase> base = passBase; | 179 RefPtrWillBeRawPtr<SVGPropertyBase> base = passBase; |
178 ASSERT(base->type() == SVGPathSegList::classType()); | 180 ASSERT(base->type() == SVGPathSegList::classType()); |
179 return static_pointer_cast<SVGPathSegList>(base.release()); | 181 return static_pointer_cast<SVGPathSegList>(base.release()); |
180 } | 182 } |
181 | 183 |
182 } // namespace blink | 184 } // namespace blink |
183 | 185 |
184 #endif | 186 #endif |
OLD | NEW |