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

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

Issue 2912663002: Clean up creation of "detached" SVG* data type objects (Closed)
Patch Set: Created 3 years, 6 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
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 } 65 }
66 66
67 float SVGPathElement::getTotalLength() { 67 float SVGPathElement::getTotalLength() {
68 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); 68 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets();
69 return SVGPathQuery(PathByteStream()).GetTotalLength(); 69 return SVGPathQuery(PathByteStream()).GetTotalLength();
70 } 70 }
71 71
72 SVGPointTearOff* SVGPathElement::getPointAtLength(float length) { 72 SVGPointTearOff* SVGPathElement::getPointAtLength(float length) {
73 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); 73 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets();
74 FloatPoint point = SVGPathQuery(PathByteStream()).GetPointAtLength(length); 74 FloatPoint point = SVGPathQuery(PathByteStream()).GetPointAtLength(length);
75 return SVGPointTearOff::Create(SVGPoint::Create(point), 0, 75 return SVGPointTearOff::CreateDetached(point);
76 kPropertyIsNotAnimVal);
77 } 76 }
78 77
79 unsigned SVGPathElement::getPathSegAtLength(float length) { 78 unsigned SVGPathElement::getPathSegAtLength(float length) {
80 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets(); 79 GetDocument().UpdateStyleAndLayoutIgnorePendingStylesheets();
81 return SVGPathQuery(PathByteStream()).GetPathSegIndexAtLength(length); 80 return SVGPathQuery(PathByteStream()).GetPathSegIndexAtLength(length);
82 } 81 }
83 82
84 void SVGPathElement::SvgAttributeChanged(const QualifiedName& attr_name) { 83 void SVGPathElement::SvgAttributeChanged(const QualifiedName& attr_name) {
85 if (attr_name == SVGNames::dAttr) { 84 if (attr_name == SVGNames::dAttr) {
86 SVGElement::InvalidationGuard invalidation_guard(this); 85 SVGElement::InvalidationGuard invalidation_guard(this);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 SVGGeometryElement::RemovedFrom(root_parent); 148 SVGGeometryElement::RemovedFrom(root_parent);
150 InvalidateMPathDependencies(); 149 InvalidateMPathDependencies();
151 } 150 }
152 151
153 FloatRect SVGPathElement::GetBBox() { 152 FloatRect SVGPathElement::GetBBox() {
154 // We want the exact bounds. 153 // We want the exact bounds.
155 return SVGPathElement::AsPath().BoundingRect(Path::BoundsType::kExact); 154 return SVGPathElement::AsPath().BoundingRect(Path::BoundsType::kExact);
156 } 155 }
157 156
158 } // namespace blink 157 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGNumberTearOff.cpp ('k') | third_party/WebKit/Source/core/svg/SVGPointListTearOff.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698