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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 if (rx <= 0) | 55 if (rx <= 0) |
56 return; | 56 return; |
57 float ry = ellipse->ryCurrentValue().value(lengthContext); | 57 float ry = ellipse->ryCurrentValue().value(lengthContext); |
58 if (ry <= 0) | 58 if (ry <= 0) |
59 return; | 59 return; |
60 path.addEllipse(FloatRect(ellipse->cxCurrentValue().value(lengthContext) - r
x, ellipse->cyCurrentValue().value(lengthContext) - ry, rx * 2, ry * 2)); | 60 path.addEllipse(FloatRect(ellipse->cxCurrentValue().value(lengthContext) - r
x, ellipse->cyCurrentValue().value(lengthContext) - ry, rx * 2, ry * 2)); |
61 } | 61 } |
62 | 62 |
63 static void updatePathFromLineElement(SVGElement* element, Path& path) | 63 static void updatePathFromLineElement(SVGElement* element, Path& path) |
64 { | 64 { |
65 ASSERT(element->hasTagName(SVGNames::lineTag)); | 65 SVGLineElement* line = toSVGLineElement(element); |
66 SVGLineElement* line = static_cast<SVGLineElement*>(element); | |
67 | 66 |
68 SVGLengthContext lengthContext(element); | 67 SVGLengthContext lengthContext(element); |
69 path.moveTo(FloatPoint(line->x1CurrentValue().value(lengthContext), line->y1
CurrentValue().value(lengthContext))); | 68 path.moveTo(FloatPoint(line->x1CurrentValue().value(lengthContext), line->y1
CurrentValue().value(lengthContext))); |
70 path.addLineTo(FloatPoint(line->x2CurrentValue().value(lengthContext), line-
>y2CurrentValue().value(lengthContext))); | 69 path.addLineTo(FloatPoint(line->x2CurrentValue().value(lengthContext), line-
>y2CurrentValue().value(lengthContext))); |
71 } | 70 } |
72 | 71 |
73 static void updatePathFromPathElement(SVGElement* element, Path& path) | 72 static void updatePathFromPathElement(SVGElement* element, Path& path) |
74 { | 73 { |
75 buildPathFromByteStream(toSVGPathElement(element)->pathByteStream(), path); | 74 buildPathFromByteStream(toSVGPathElement(element)->pathByteStream(), path); |
76 } | 75 } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 map->set(SVGNames::polygonTag.localName().impl(), updatePathFromPolygonE
lement); | 154 map->set(SVGNames::polygonTag.localName().impl(), updatePathFromPolygonE
lement); |
156 map->set(SVGNames::polylineTag.localName().impl(), updatePathFromPolylin
eElement); | 155 map->set(SVGNames::polylineTag.localName().impl(), updatePathFromPolylin
eElement); |
157 map->set(SVGNames::rectTag.localName().impl(), updatePathFromRectElement
); | 156 map->set(SVGNames::rectTag.localName().impl(), updatePathFromRectElement
); |
158 } | 157 } |
159 | 158 |
160 if (PathUpdateFunction pathUpdateFunction = map->get(element->localName().im
pl())) | 159 if (PathUpdateFunction pathUpdateFunction = map->get(element->localName().im
pl())) |
161 (*pathUpdateFunction)(element, path); | 160 (*pathUpdateFunction)(element, path); |
162 } | 161 } |
163 | 162 |
164 } // namespace WebCore | 163 } // namespace WebCore |
OLD | NEW |