OLD | NEW |
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 float LayoutSVGResourceRadialGradient::radius(const RadialGradientAttributes& at
tributes) const | 54 float LayoutSVGResourceRadialGradient::radius(const RadialGradientAttributes& at
tributes) const |
55 { | 55 { |
56 return SVGLengthContext::resolveLength(element(), attributes.gradientUnits()
, *attributes.r()); | 56 return SVGLengthContext::resolveLength(element(), attributes.gradientUnits()
, *attributes.r()); |
57 } | 57 } |
58 | 58 |
59 float LayoutSVGResourceRadialGradient::focalRadius(const RadialGradientAttribute
s& attributes) const | 59 float LayoutSVGResourceRadialGradient::focalRadius(const RadialGradientAttribute
s& attributes) const |
60 { | 60 { |
61 return SVGLengthContext::resolveLength(element(), attributes.gradientUnits()
, *attributes.fr()); | 61 return SVGLengthContext::resolveLength(element(), attributes.gradientUnits()
, *attributes.fr()); |
62 } | 62 } |
63 | 63 |
64 void LayoutSVGResourceRadialGradient::buildGradient(GradientData* gradientData)
const | 64 PassRefPtr<Gradient> LayoutSVGResourceRadialGradient::buildGradient() const |
65 { | 65 { |
66 const RadialGradientAttributes& attributes = this->attributes(); | 66 const RadialGradientAttributes& attributes = this->attributes(); |
67 gradientData->gradient = Gradient::create(this->focalPoint(attributes), | 67 RefPtr<Gradient> gradient = Gradient::create( |
68 this->focalRadius(attributes), | 68 focalPoint(attributes), focalRadius(attributes), |
69 this->centerPoint(attributes), | 69 centerPoint(attributes), radius(attributes)); |
70 this->radius(attributes)); | 70 gradient->setSpreadMethod(platformSpreadMethodFromSVGType(attributes.spreadM
ethod())); |
71 | 71 addStops(*gradient, attributes.stops()); |
72 gradientData->gradient->setSpreadMethod(platformSpreadMethodFromSVGType(attr
ibutes.spreadMethod())); | 72 return gradient.release(); |
73 | |
74 addStops(gradientData, attributes.stops()); | |
75 } | 73 } |
76 | 74 |
77 } // namespace blink | 75 } // namespace blink |
OLD | NEW |