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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 path.addLineTo(FloatPoint(line->x2()->currentValue()->value(lengthContext),
line->y2()->currentValue()->value(lengthContext))); | 72 path.addLineTo(FloatPoint(line->x2()->currentValue()->value(lengthContext),
line->y2()->currentValue()->value(lengthContext))); |
73 } | 73 } |
74 | 74 |
75 static void updatePathFromPathElement(SVGElement* element, Path& path) | 75 static void updatePathFromPathElement(SVGElement* element, Path& path) |
76 { | 76 { |
77 buildPathFromByteStream(toSVGPathElement(element)->pathByteStream(), path); | 77 buildPathFromByteStream(toSVGPathElement(element)->pathByteStream(), path); |
78 } | 78 } |
79 | 79 |
80 static void updatePathFromPolylineElement(SVGElement* element, Path& path) | 80 static void updatePathFromPolylineElement(SVGElement* element, Path& path) |
81 { | 81 { |
82 RefPtr<SVGPointList> points = toSVGPolyElement(element)->points()->currentVa
lue(); | 82 RefPtrWillBeRawPtr<SVGPointList> points = toSVGPolyElement(element)->points(
)->currentValue(); |
83 if (points->isEmpty()) | 83 if (points->isEmpty()) |
84 return; | 84 return; |
85 | 85 |
86 SVGPointList::ConstIterator it = points->begin(); | 86 SVGPointList::ConstIterator it = points->begin(); |
87 SVGPointList::ConstIterator itEnd = points->end(); | 87 SVGPointList::ConstIterator itEnd = points->end(); |
88 ASSERT(it != itEnd); | 88 ASSERT(it != itEnd); |
89 path.moveTo(it->value()); | 89 path.moveTo(it->value()); |
90 ++it; | 90 ++it; |
91 | 91 |
92 for (; it != itEnd; ++it) | 92 for (; it != itEnd; ++it) |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 map->set(polygonTag.localName().impl(), updatePathFromPolygonElement); | 147 map->set(polygonTag.localName().impl(), updatePathFromPolygonElement); |
148 map->set(polylineTag.localName().impl(), updatePathFromPolylineElement); | 148 map->set(polylineTag.localName().impl(), updatePathFromPolylineElement); |
149 map->set(rectTag.localName().impl(), updatePathFromRectElement); | 149 map->set(rectTag.localName().impl(), updatePathFromRectElement); |
150 } | 150 } |
151 | 151 |
152 if (PathUpdateFunction pathUpdateFunction = map->get(element->localName().im
pl())) | 152 if (PathUpdateFunction pathUpdateFunction = map->get(element->localName().im
pl())) |
153 (*pathUpdateFunction)(element, path); | 153 (*pathUpdateFunction)(element, path); |
154 } | 154 } |
155 | 155 |
156 } // namespace blink | 156 } // namespace blink |
OLD | NEW |