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

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

Issue 22897011: Introduce toSVGRadialGradientElement(), and use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 4 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) 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
4 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. 4 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 24 matching lines...) Expand all
35 { 35 {
36 } 36 }
37 37
38 RenderSVGResourceRadialGradient::~RenderSVGResourceRadialGradient() 38 RenderSVGResourceRadialGradient::~RenderSVGResourceRadialGradient()
39 { 39 {
40 } 40 }
41 41
42 bool RenderSVGResourceRadialGradient::collectGradientAttributes(SVGGradientEleme nt* gradientElement) 42 bool RenderSVGResourceRadialGradient::collectGradientAttributes(SVGGradientEleme nt* gradientElement)
43 { 43 {
44 m_attributes = RadialGradientAttributes(); 44 m_attributes = RadialGradientAttributes();
45 return static_cast<SVGRadialGradientElement*>(gradientElement)->collectGradi entAttributes(m_attributes); 45 return toSVGRadialGradientElement(gradientElement)->collectGradientAttribute s(m_attributes);
46 } 46 }
47 47
48 FloatPoint RenderSVGResourceRadialGradient::centerPoint(const RadialGradientAttr ibutes& attributes) const 48 FloatPoint RenderSVGResourceRadialGradient::centerPoint(const RadialGradientAttr ibutes& attributes) const
49 { 49 {
50 return SVGLengthContext::resolvePoint(static_cast<const SVGElement*>(node()) , attributes.gradientUnits(), attributes.cx(), attributes.cy()); 50 return SVGLengthContext::resolvePoint(static_cast<const SVGElement*>(node()) , attributes.gradientUnits(), attributes.cx(), attributes.cy());
51 } 51 }
52 52
53 FloatPoint RenderSVGResourceRadialGradient::focalPoint(const RadialGradientAttri butes& attributes) const 53 FloatPoint RenderSVGResourceRadialGradient::focalPoint(const RadialGradientAttri butes& attributes) const
54 { 54 {
55 return SVGLengthContext::resolvePoint(static_cast<const SVGElement*>(node()) , attributes.gradientUnits(), attributes.fx(), attributes.fy()); 55 return SVGLengthContext::resolvePoint(static_cast<const SVGElement*>(node()) , attributes.gradientUnits(), attributes.fx(), attributes.fy());
(...skipping 15 matching lines...) Expand all
71 this->focalRadius(m_attributes), 71 this->focalRadius(m_attributes),
72 this->centerPoint(m_attributes), 72 this->centerPoint(m_attributes),
73 this->radius(m_attributes)); 73 this->radius(m_attributes));
74 74
75 gradientData->gradient->setSpreadMethod(platformSpreadMethodFromSVGType(m_at tributes.spreadMethod())); 75 gradientData->gradient->setSpreadMethod(platformSpreadMethodFromSVGType(m_at tributes.spreadMethod()));
76 76
77 addStops(gradientData, m_attributes.stops()); 77 addStops(gradientData, m_attributes.stops());
78 } 78 }
79 79
80 } 80 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourceGradient.cpp ('k') | Source/core/rendering/svg/SVGRenderTreeAsText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698