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

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

Issue 2031053004: Reduce LayoutSVGResource*Gradient building dependency on GradientData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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) 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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698