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

Unified Diff: Source/core/rendering/svg/RenderSVGEllipse.cpp

Issue 191003007: Use isSVG*Element() helpers more in SVG code (Part 3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/rendering/svg/RenderSVGEllipse.cpp
diff --git a/Source/core/rendering/svg/RenderSVGEllipse.cpp b/Source/core/rendering/svg/RenderSVGEllipse.cpp
index 1b09e252098d68f22edb2d099988b92c0b247811..bcd290028b12c6c03e958d032323cc9d88f77976 100644
--- a/Source/core/rendering/svg/RenderSVGEllipse.cpp
+++ b/Source/core/rendering/svg/RenderSVGEllipse.cpp
@@ -76,21 +76,21 @@ void RenderSVGEllipse::updateShapeFromElement()
void RenderSVGEllipse::calculateRadiiAndCenter()
{
ASSERT(element());
- if (element()->hasTagName(SVGNames::circleTag)) {
- SVGCircleElement* circle = toSVGCircleElement(element());
+ if (isSVGCircleElement(*element())) {
+ SVGCircleElement& circle = toSVGCircleElement(*element());
- SVGLengthContext lengthContext(circle);
- float radius = circle->r()->currentValue()->value(lengthContext);
+ SVGLengthContext lengthContext(&circle);
+ float radius = circle.r()->currentValue()->value(lengthContext);
m_radii = FloatSize(radius, radius);
- m_center = FloatPoint(circle->cx()->currentValue()->value(lengthContext), circle->cy()->currentValue()->value(lengthContext));
+ m_center = FloatPoint(circle.cx()->currentValue()->value(lengthContext), circle.cy()->currentValue()->value(lengthContext));
return;
}
- SVGEllipseElement* ellipse = toSVGEllipseElement(element());
+ SVGEllipseElement& ellipse = toSVGEllipseElement(*element());
- SVGLengthContext lengthContext(ellipse);
- m_radii = FloatSize(ellipse->rx()->currentValue()->value(lengthContext), ellipse->ry()->currentValue()->value(lengthContext));
- m_center = FloatPoint(ellipse->cx()->currentValue()->value(lengthContext), ellipse->cy()->currentValue()->value(lengthContext));
+ SVGLengthContext lengthContext(&ellipse);
+ m_radii = FloatSize(ellipse.rx()->currentValue()->value(lengthContext), ellipse.ry()->currentValue()->value(lengthContext));
+ m_center = FloatPoint(ellipse.cx()->currentValue()->value(lengthContext), ellipse.cy()->currentValue()->value(lengthContext));
}
void RenderSVGEllipse::fillShape(GraphicsContext* context) const
« no previous file with comments | « Source/core/rendering/svg/ReferenceFilterBuilder.cpp ('k') | Source/core/rendering/svg/RenderSVGGradientStop.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698