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

Side by Side Diff: Source/core/svg/SVGPathElement.cpp

Issue 132233016: [SVG] SVGAnimatedPointList migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: set NeedsRebaseline Created 6 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGPathElement.h ('k') | Source/core/svg/SVGPathTraversalStateBuilder.h » ('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) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 28 matching lines...) Expand all
39 #include "core/svg/SVGPathSegCurvetoQuadraticSmoothRel.h" 39 #include "core/svg/SVGPathSegCurvetoQuadraticSmoothRel.h"
40 #include "core/svg/SVGPathSegLinetoAbs.h" 40 #include "core/svg/SVGPathSegLinetoAbs.h"
41 #include "core/svg/SVGPathSegLinetoHorizontalAbs.h" 41 #include "core/svg/SVGPathSegLinetoHorizontalAbs.h"
42 #include "core/svg/SVGPathSegLinetoHorizontalRel.h" 42 #include "core/svg/SVGPathSegLinetoHorizontalRel.h"
43 #include "core/svg/SVGPathSegLinetoRel.h" 43 #include "core/svg/SVGPathSegLinetoRel.h"
44 #include "core/svg/SVGPathSegLinetoVerticalAbs.h" 44 #include "core/svg/SVGPathSegLinetoVerticalAbs.h"
45 #include "core/svg/SVGPathSegLinetoVerticalRel.h" 45 #include "core/svg/SVGPathSegLinetoVerticalRel.h"
46 #include "core/svg/SVGPathSegMovetoAbs.h" 46 #include "core/svg/SVGPathSegMovetoAbs.h"
47 #include "core/svg/SVGPathSegMovetoRel.h" 47 #include "core/svg/SVGPathSegMovetoRel.h"
48 #include "core/svg/SVGPathUtilities.h" 48 #include "core/svg/SVGPathUtilities.h"
49 #include "core/svg/SVGPointTearOff.h"
49 #include "core/svg/properties/SVGPathSegListPropertyTearOff.h" 50 #include "core/svg/properties/SVGPathSegListPropertyTearOff.h"
50 51
51 namespace WebCore { 52 namespace WebCore {
52 53
53 // Define custom animated property 'd'. 54 // Define custom animated property 'd'.
54 const SVGPropertyInfo* SVGPathElement::dPropertyInfo() 55 const SVGPropertyInfo* SVGPathElement::dPropertyInfo()
55 { 56 {
56 static const SVGPropertyInfo* s_propertyInfo = 0; 57 static const SVGPropertyInfo* s_propertyInfo = 0;
57 if (!s_propertyInfo) { 58 if (!s_propertyInfo) {
58 s_propertyInfo = new SVGPropertyInfo(AnimatedPath, 59 s_propertyInfo = new SVGPropertyInfo(AnimatedPath,
(...skipping 30 matching lines...) Expand all
89 return adoptRef(new SVGPathElement(document)); 90 return adoptRef(new SVGPathElement(document));
90 } 91 }
91 92
92 float SVGPathElement::getTotalLength() 93 float SVGPathElement::getTotalLength()
93 { 94 {
94 float totalLength = 0; 95 float totalLength = 0;
95 getTotalLengthOfSVGPathByteStream(pathByteStream(), totalLength); 96 getTotalLengthOfSVGPathByteStream(pathByteStream(), totalLength);
96 return totalLength; 97 return totalLength;
97 } 98 }
98 99
99 SVGPoint SVGPathElement::getPointAtLength(float length) 100 PassRefPtr<SVGPointTearOff> SVGPathElement::getPointAtLength(float length)
100 { 101 {
101 SVGPoint point; 102 FloatPoint point;
102 getPointAtLengthOfSVGPathByteStream(pathByteStream(), length, point); 103 getPointAtLengthOfSVGPathByteStream(pathByteStream(), length, point);
103 return point; 104 return SVGPointTearOff::create(SVGPoint::create(point), 0, PropertyIsNotAnim Val);
104 } 105 }
105 106
106 unsigned SVGPathElement::getPathSegAtLength(float length) 107 unsigned SVGPathElement::getPathSegAtLength(float length)
107 { 108 {
108 unsigned pathSeg = 0; 109 unsigned pathSeg = 0;
109 getSVGPathSegAtLengthFromSVGPathByteStream(pathByteStream(), length, pathSeg ); 110 getSVGPathSegAtLengthFromSVGPathByteStream(pathByteStream(), length, pathSeg );
110 return pathSeg; 111 return pathSeg;
111 } 112 }
112 113
113 PassRefPtr<SVGPathSegClosePath> SVGPathElement::createSVGPathSegClosePath(SVGPat hSegRole role) 114 PassRefPtr<SVGPathSegClosePath> SVGPathElement::createSVGPathSegClosePath(SVGPat hSegRole role)
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 386
386 // FIXME: Eventually we should support getBBox for detached elements. 387 // FIXME: Eventually we should support getBBox for detached elements.
387 if (!renderer()) 388 if (!renderer())
388 return FloatRect(); 389 return FloatRect();
389 390
390 RenderSVGPath* renderer = toRenderSVGPath(this->renderer()); 391 RenderSVGPath* renderer = toRenderSVGPath(this->renderer());
391 return renderer->path().boundingRect(); 392 return renderer->path().boundingRect();
392 } 393 }
393 394
394 } 395 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGPathElement.h ('k') | Source/core/svg/SVGPathTraversalStateBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698