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

Side by Side Diff: Source/core/rendering/svg/SVGPathData.cpp

Issue 55893002: <animate> not working on SVG Polygons. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 | « no previous file | Source/core/rendering/svg/SVGRenderTreeAsText.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) 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 path.addLineTo(FloatPoint(line->x2CurrentValue().value(lengthContext), line- >y2CurrentValue().value(lengthContext))); 67 path.addLineTo(FloatPoint(line->x2CurrentValue().value(lengthContext), line- >y2CurrentValue().value(lengthContext)));
68 } 68 }
69 69
70 static void updatePathFromPathElement(SVGElement* element, Path& path) 70 static void updatePathFromPathElement(SVGElement* element, Path& path)
71 { 71 {
72 buildPathFromByteStream(toSVGPathElement(element)->pathByteStream(), path); 72 buildPathFromByteStream(toSVGPathElement(element)->pathByteStream(), path);
73 } 73 }
74 74
75 static void updatePathFromPolygonElement(SVGElement* element, Path& path) 75 static void updatePathFromPolygonElement(SVGElement* element, Path& path)
76 { 76 {
77 SVGPointList& points = toSVGPolygonElement(element)->pointList(); 77 SVGPointList& points = toSVGPolygonElement(element)->pointsCurrentValue();
78 if (points.isEmpty()) 78 if (points.isEmpty())
79 return; 79 return;
80 80
81 path.moveTo(points.first()); 81 path.moveTo(points.first());
82 82
83 unsigned size = points.size(); 83 unsigned size = points.size();
84 for (unsigned i = 1; i < size; ++i) 84 for (unsigned i = 1; i < size; ++i)
85 path.addLineTo(points.at(i)); 85 path.addLineTo(points.at(i));
86 86
87 path.closeSubpath(); 87 path.closeSubpath();
88 } 88 }
89 89
90 static void updatePathFromPolylineElement(SVGElement* element, Path& path) 90 static void updatePathFromPolylineElement(SVGElement* element, Path& path)
91 { 91 {
92 SVGPointList& points = toSVGPolylineElement(element)->pointList(); 92 SVGPointList& points = toSVGPolylineElement(element)->pointsCurrentValue();
93 if (points.isEmpty()) 93 if (points.isEmpty())
94 return; 94 return;
95 95
96 path.moveTo(points.first()); 96 path.moveTo(points.first());
97 97
98 unsigned size = points.size(); 98 unsigned size = points.size();
99 for (unsigned i = 1; i < size; ++i) 99 for (unsigned i = 1; i < size; ++i)
100 path.addLineTo(points.at(i)); 100 path.addLineTo(points.at(i));
101 } 101 }
102 102
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 map->set(SVGNames::polygonTag.localName().impl(), updatePathFromPolygonE lement); 146 map->set(SVGNames::polygonTag.localName().impl(), updatePathFromPolygonE lement);
147 map->set(SVGNames::polylineTag.localName().impl(), updatePathFromPolylin eElement); 147 map->set(SVGNames::polylineTag.localName().impl(), updatePathFromPolylin eElement);
148 map->set(SVGNames::rectTag.localName().impl(), updatePathFromRectElement ); 148 map->set(SVGNames::rectTag.localName().impl(), updatePathFromRectElement );
149 } 149 }
150 150
151 if (PathUpdateFunction pathUpdateFunction = map->get(element->localName().im pl())) 151 if (PathUpdateFunction pathUpdateFunction = map->get(element->localName().im pl()))
152 (*pathUpdateFunction)(element, path); 152 (*pathUpdateFunction)(element, path);
153 } 153 }
154 154
155 } // namespace WebCore 155 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/svg/SVGRenderTreeAsText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698