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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceRadialGradient.cpp
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceRadialGradient.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceRadialGradient.cpp
index c5f3add06ccf11d55c0b18d4ee0ffb57c1637825..65b122459caa2adfa157c3bc170a9a1e62b555a7 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceRadialGradient.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceRadialGradient.cpp
@@ -61,17 +61,15 @@ float LayoutSVGResourceRadialGradient::focalRadius(const RadialGradientAttribute
return SVGLengthContext::resolveLength(element(), attributes.gradientUnits(), *attributes.fr());
}
-void LayoutSVGResourceRadialGradient::buildGradient(GradientData* gradientData) const
+PassRefPtr<Gradient> LayoutSVGResourceRadialGradient::buildGradient() const
{
const RadialGradientAttributes& attributes = this->attributes();
- gradientData->gradient = Gradient::create(this->focalPoint(attributes),
- this->focalRadius(attributes),
- this->centerPoint(attributes),
- this->radius(attributes));
-
- gradientData->gradient->setSpreadMethod(platformSpreadMethodFromSVGType(attributes.spreadMethod()));
-
- addStops(gradientData, attributes.stops());
+ RefPtr<Gradient> gradient = Gradient::create(
+ focalPoint(attributes), focalRadius(attributes),
+ centerPoint(attributes), radius(attributes));
+ gradient->setSpreadMethod(platformSpreadMethodFromSVGType(attributes.spreadMethod()));
+ addStops(*gradient, attributes.stops());
+ return gradient.release();
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698