OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 path.addRect(FloatRect(x, y, width, height)); | 140 path.addRect(FloatRect(x, y, width, height)); |
141 } | 141 } |
142 | 142 |
143 void updatePathFromGraphicsElement(SVGElement* element, Path& path) | 143 void updatePathFromGraphicsElement(SVGElement* element, Path& path) |
144 { | 144 { |
145 ASSERT(element); | 145 ASSERT(element); |
146 ASSERT(path.isEmpty()); | 146 ASSERT(path.isEmpty()); |
147 | 147 |
148 typedef void (*PathUpdateFunction)(SVGElement*, Path&); | 148 typedef void (*PathUpdateFunction)(SVGElement*, Path&); |
149 static HashMap<AtomicStringImpl*, PathUpdateFunction>* map = 0; | 149 static HashMap<StringImpl*, PathUpdateFunction>* map = 0; |
150 if (!map) { | 150 if (!map) { |
151 map = new HashMap<AtomicStringImpl*, PathUpdateFunction>; | 151 map = new HashMap<StringImpl*, PathUpdateFunction>; |
152 map->set(SVGNames::circleTag.localName().impl(), updatePathFromCircleEle
ment); | 152 map->set(SVGNames::circleTag.localName().impl(), updatePathFromCircleEle
ment); |
153 map->set(SVGNames::ellipseTag.localName().impl(), updatePathFromEllipseE
lement); | 153 map->set(SVGNames::ellipseTag.localName().impl(), updatePathFromEllipseE
lement); |
154 map->set(SVGNames::lineTag.localName().impl(), updatePathFromLineElement
); | 154 map->set(SVGNames::lineTag.localName().impl(), updatePathFromLineElement
); |
155 map->set(SVGNames::pathTag.localName().impl(), updatePathFromPathElement
); | 155 map->set(SVGNames::pathTag.localName().impl(), updatePathFromPathElement
); |
156 map->set(SVGNames::polygonTag.localName().impl(), updatePathFromPolygonE
lement); | 156 map->set(SVGNames::polygonTag.localName().impl(), updatePathFromPolygonE
lement); |
157 map->set(SVGNames::polylineTag.localName().impl(), updatePathFromPolylin
eElement); | 157 map->set(SVGNames::polylineTag.localName().impl(), updatePathFromPolylin
eElement); |
158 map->set(SVGNames::rectTag.localName().impl(), updatePathFromRectElement
); | 158 map->set(SVGNames::rectTag.localName().impl(), updatePathFromRectElement
); |
159 } | 159 } |
160 | 160 |
161 if (PathUpdateFunction pathUpdateFunction = map->get(element->localName().im
pl())) | 161 if (PathUpdateFunction pathUpdateFunction = map->get(element->localName().im
pl())) |
162 (*pathUpdateFunction)(element, path); | 162 (*pathUpdateFunction)(element, path); |
163 } | 163 } |
164 | 164 |
165 } // namespace WebCore | 165 } // namespace WebCore |
OLD | NEW |