WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-220079-20201221211808.patch (text/plain), 44.98 KB, created by
Said Abou-Hallawa
on 2020-12-21 21:18:09 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Said Abou-Hallawa
Created:
2020-12-21 21:18:09 PST
Size:
44.98 KB
patch
obsolete
>Subversion Revision: 271025 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index b5e71124fd5e20a52fa9d262eed52dfe44be78c4..3f0aac0b2c378b6afc1f990f1578243adbd745ef 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,82 @@ >+2020-12-21 Said Abou-Hallawa <said@apple.com> >+ >+ Move the gradient painting data outside the Gradient class >+ https://bugs.webkit.org/show_bug.cgi?id=220079 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Move the SpreadMethod and the SpaceTransform from the Gradient class to >+ the GraphicsContextState into a new struct called Gradient::PaintingData. >+ The client will set them when calling GraphicsContext::setFillGradient() >+ and GraphicsContext::setFillGradient(). >+ >+ * platform/graphics/Gradient.cpp: >+ (WebCore::Gradient::addColorStop): >+ (WebCore::Gradient::setSortedColorStops): >+ (WebCore::Gradient::setSpreadMethod): Deleted. >+ (WebCore::Gradient::setGradientSpaceTransform): Deleted. >+ (WebCore::add): Deleted. >+ (WebCore::Gradient::hash const): Deleted. >+ * platform/graphics/Gradient.h: >+ (WebCore::Gradient::encode const): >+ (WebCore::Gradient::decode): >+ (WebCore::Gradient::spreadMethod const): Deleted. >+ (WebCore::Gradient::gradientSpaceTransform const): Deleted. >+ * platform/graphics/GradientImage.cpp: >+ (WebCore::GradientImage::drawPattern): >+ * platform/graphics/GradientImage.h: >+ No need for the Gradient::hash(). New stops can only be added to the >+ existing stops. Clients need to check for the stops' size if they want >+ to invalidate their cached drawing. >+ >+ * platform/graphics/GraphicsContext.cpp: >+ (WebCore::GraphicsContextStateChange::apply const): >+ (WebCore::GraphicsContext::setStrokeGradient): >+ (WebCore::GraphicsContext::setFillGradient): >+ * platform/graphics/GraphicsContext.h: >+ (WebCore::GraphicsContext::setStrokeGradient): >+ (WebCore::GraphicsContext::setFillGradient): >+ * platform/graphics/cairo/CairoOperations.cpp: >+ (WebCore::Cairo::FillSource::FillSource): >+ (WebCore::Cairo::StrokeSource::StrokeSource): >+ * platform/graphics/cairo/GradientCairo.cpp: >+ (WebCore::Gradient::createPattern): >+ (WebCore::Gradient::fill): >+ * platform/graphics/cairo/GraphicsContextImplCairo.cpp: >+ (WebCore::GraphicsContextImplCairo::fillRect): >+ * platform/graphics/cg/GradientCG.cpp: >+ (WebCore::Gradient::paint): >+ * platform/graphics/cg/GraphicsContextCG.cpp: >+ (WebCore::GraphicsContext::fillPath): >+ (WebCore::GraphicsContext::strokePath): >+ (WebCore::GraphicsContext::fillRect): >+ (WebCore::GraphicsContext::strokeRect): >+ * platform/graphics/displaylists/DisplayListDrawGlyphsRecorder.h: >+ * platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp: >+ (WebCore::DisplayList::DrawGlyphsRecorder::populateInternalState): >+ (WebCore::DisplayList::DrawGlyphsRecorder::populateInternalContext): >+ * platform/graphics/displaylists/DisplayListItems.cpp: >+ (WebCore::DisplayList::SetInlineFillGradient::SetInlineFillGradient): >+ (WebCore::DisplayList::SetInlineFillGradient::gradient const): >+ (WebCore::DisplayList::SetInlineFillGradient::apply const): >+ * platform/graphics/displaylists/DisplayListItems.h: >+ * platform/graphics/displaylists/DisplayListRecorder.cpp: >+ (WebCore::DisplayList::Recorder::appendStateChangeItem): >+ * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: >+ (Nicosia::CairoOperationRecorder::fillRect): >+ * rendering/svg/RenderSVGPath.cpp: >+ (WebCore::useStrokeStyleToFill): >+ * rendering/svg/RenderSVGResourceGradient.cpp: >+ (WebCore::RenderSVGResourceGradient::applyResource): >+ (WebCore::RenderSVGResourceGradient::postApplyResource): >+ * rendering/svg/RenderSVGResourceGradient.h: >+ * rendering/svg/RenderSVGResourceLinearGradient.cpp: >+ (WebCore::RenderSVGResourceLinearGradient::buildGradient const): >+ * rendering/svg/RenderSVGResourceLinearGradient.h: >+ * rendering/svg/RenderSVGResourceRadialGradient.cpp: >+ (WebCore::RenderSVGResourceRadialGradient::buildGradient const): >+ * rendering/svg/RenderSVGResourceRadialGradient.h: >+ > 2020-12-21 Megan Gardner <megan_gardner@apple.com> > > Copy Localizable.strings file into the correct directory >diff --git a/Source/WebCore/platform/graphics/Gradient.cpp b/Source/WebCore/platform/graphics/Gradient.cpp >index e170f96a1b6ef535bc5a823ca11d7a750421efcd..98db7b6d794b14e48e6b658c93a74824fad3b218 100644 >--- a/Source/WebCore/platform/graphics/Gradient.cpp >+++ b/Source/WebCore/platform/graphics/Gradient.cpp >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2006, 2007, 2008, 2010 Apple Inc. All rights reserved. >+ * Copyright (C) 2006-2020 Apple Inc. All rights reserved. > * Copyright (C) 2007 Alp Toker <alp@atoker.com> > * > * Redistribution and use in source and binary forms, with or without >@@ -46,8 +46,6 @@ Gradient::Gradient(Data&& data) > { > } > >-Gradient::~Gradient() = default; >- > void Gradient::adjustParametersForTiledDrawing(FloatSize& size, FloatRect& srcRect, const FloatSize& spacing) > { > if (srcRect.isEmpty()) >@@ -97,7 +95,6 @@ void Gradient::addColorStop(Gradient::ColorStop&& stop) > { > m_stops.append(WTFMove(stop)); > m_stopsSorted = false; >- m_cachedHash = 0; > stopsChanged(); > } > >@@ -105,7 +102,6 @@ void Gradient::setSortedColorStops(ColorStopVector&& stops) > { > m_stops = WTFMove(stops); > m_stopsSorted = true; >- m_cachedHash = 0; > stopsChanged(); > } > >@@ -119,67 +115,4 @@ void Gradient::sortStops() const > }); > } > >-void Gradient::setSpreadMethod(GradientSpreadMethod spreadMethod) >-{ >- if (m_spreadMethod == spreadMethod) >- return; >- m_spreadMethod = spreadMethod; >- m_cachedHash = 0; >-} >- >-void Gradient::setGradientSpaceTransform(const AffineTransform& gradientSpaceTransformation) >-{ >- if (m_gradientSpaceTransformation == gradientSpaceTransformation) >- return; >- m_gradientSpaceTransformation = gradientSpaceTransformation; >- m_cachedHash = 0; >-} >- >-// FIXME: Instead of these add(Hasher) functions, consider using encode functions to compute the hash. >- >-static void add(Hasher& hasher, const Color& color) >-{ >- // FIXME: We don't want to hash a hash; do better. >- add(hasher, color.hash()); >-} >- >-static void add(Hasher& hasher, const FloatPoint& point) >-{ >- add(hasher, point.x(), point.y()); >-} >- >-static void add(Hasher& hasher, const AffineTransform& transform) >-{ >- add(hasher, transform.a(), transform.b(), transform.c(), transform.d(), transform.e(), transform.f()); >-} >- >-static void add(Hasher& hasher, const Gradient::ColorStop& stop) >-{ >- add(hasher, stop.offset, stop.color); >-} >- >-static void add(Hasher& hasher, const Gradient::LinearData& data) >-{ >- add(hasher, data.point0, data.point1); >-} >- >-static void add(Hasher& hasher, const Gradient::RadialData& data) >-{ >- add(hasher, data.point0, data.point1, data.startRadius, data.endRadius, data.aspectRatio); >-} >- >-static void add(Hasher& hasher, const Gradient::ConicData& data) >-{ >- add(hasher, data.point0, data.angleRadians); >-} >- >-unsigned Gradient::hash() const >-{ >- if (!m_cachedHash) { >- sortStops(); >- m_cachedHash = computeHash(m_data, m_spreadMethod, m_gradientSpaceTransformation, m_stops); >- } >- return m_cachedHash; >-} >- > } >diff --git a/Source/WebCore/platform/graphics/Gradient.h b/Source/WebCore/platform/graphics/Gradient.h >index 81e9ce1b8e91a52520c3717978e7bd4a37a6e9dc..4a1599ee22712f33756b48ceeea4763fc513b043 100644 >--- a/Source/WebCore/platform/graphics/Gradient.h >+++ b/Source/WebCore/platform/graphics/Gradient.h >@@ -1,5 +1,5 @@ > /* >- * Copyright (C) 2006, 2007, 2008, 2011, 2012, 2013 Apple Inc. All rights reserved. >+ * Copyright (C) 2006-2020 Apple Inc. All rights reserved. > * Copyright (C) 2007 Alp Toker <alp@atoker.com> > * Copyright (C) 2008 Torch Mobile, Inc. > * >@@ -73,6 +73,11 @@ public: > > using ColorStopVector = Vector<ColorStop, 2>; > >+ struct PaintingData { >+ GradientSpreadMethod spreadMethod { GradientSpreadMethod::Pad }; >+ AffineTransform spaceTransform; >+ }; >+ > struct LinearData { > FloatPoint point0; > FloatPoint point1; >@@ -104,8 +109,6 @@ public: > > WEBCORE_EXPORT static Ref<Gradient> create(Data&&); > >- WEBCORE_EXPORT ~Gradient(); >- > bool isZeroSize() const; > > const Data& data() const { return m_data; } >@@ -115,24 +118,16 @@ public: > > const ColorStopVector& stops() const { return m_stops; } > >- WEBCORE_EXPORT void setSpreadMethod(GradientSpreadMethod); >- GradientSpreadMethod spreadMethod() const { return m_spreadMethod; } >- >- WEBCORE_EXPORT void setGradientSpaceTransform(const AffineTransform& gradientSpaceTransformation); >- const AffineTransform& gradientSpaceTransform() const { return m_gradientSpaceTransformation; } >- > void fill(GraphicsContext&, const FloatRect&); > void adjustParametersForTiledDrawing(FloatSize&, FloatRect&, const FloatSize& spacing); > >- unsigned hash() const; >- > #if USE(CAIRO) >- RefPtr<cairo_pattern_t> createPattern(float globalAlpha); >+ RefPtr<cairo_pattern_t> createPattern(float globalAlpha, GradientSpreadMethod); > #endif > > #if USE(CG) > void paint(GraphicsContext&); >- void paint(CGContextRef); >+ void paint(CGContextRef, GradientSpreadMethod); > #endif > > #if USE(DIRECT2D) >@@ -155,9 +150,6 @@ private: > Data m_data; > mutable ColorStopVector m_stops; > mutable bool m_stopsSorted { false }; >- GradientSpreadMethod m_spreadMethod { GradientSpreadMethod::Pad }; >- mutable unsigned m_cachedHash { 0 }; >- AffineTransform m_gradientSpaceTransformation; > > #if USE(CG) > RetainPtr<CGGradientRef> m_gradient; >@@ -275,8 +267,6 @@ template<typename Encoder> void Gradient::encode(Encoder& encoder) const > encoder << m_data; > encoder << m_stops; > encoder << m_stopsSorted; >- encoder << m_spreadMethod; >- encoder << m_gradientSpaceTransformation; > } > > template<typename Decoder> Optional<Ref<Gradient>> Gradient::decode(Decoder& decoder) >@@ -302,17 +292,6 @@ template<typename Decoder> Optional<Ref<Gradient>> Gradient::decode(Decoder& dec > gradient->addColorStop(WTFMove(stop)); > } > >- GradientSpreadMethod spreadMethod; >- if (!decoder.decode(spreadMethod)) >- return WTF::nullopt; >- gradient->setSpreadMethod(spreadMethod); >- >- Optional<AffineTransform> gradientSpaceTransformation; >- decoder >> gradientSpaceTransformation; >- if (!gradientSpaceTransformation) >- return WTF::nullopt; >- gradient->setGradientSpaceTransform(WTFMove(*gradientSpaceTransformation)); >- > return gradient; > } > >diff --git a/Source/WebCore/platform/graphics/GradientImage.cpp b/Source/WebCore/platform/graphics/GradientImage.cpp >index 3114db9016eeb7fac98ef5f5783604c5c0840fe0..ef1e292faa6fc3a60054999ca34ae6e52fcae895 100644 >--- a/Source/WebCore/platform/graphics/GradientImage.cpp >+++ b/Source/WebCore/platform/graphics/GradientImage.cpp >@@ -69,9 +69,9 @@ void GradientImage::drawPattern(GraphicsContext& destContext, const FloatRect& d > adjustedPatternCTM.scale(1.0 / xScale, 1.0 / yScale); > adjustedSrcRect.scale(xScale, yScale); > >- unsigned generatorHash = m_gradient->hash(); >+ size_t generatorStopsSize = m_gradient->stops().size(); > >- if (!m_cachedImage || m_cachedGeneratorHash != generatorHash || m_cachedAdjustedSize != adjustedSize || !areEssentiallyEqual(destContext.scaleFactor(), m_cachedScaleFactor)) { >+ if (!m_cachedImage || m_cachedGeneratorStopsSize != generatorStopsSize || m_cachedAdjustedSize != adjustedSize || !areEssentiallyEqual(destContext.scaleFactor(), m_cachedScaleFactor)) { > auto imageBuffer = ImageBuffer::createCompatibleBuffer(adjustedSize, ColorSpace::SRGB, destContext); > if (!imageBuffer) > return; >@@ -79,7 +79,7 @@ void GradientImage::drawPattern(GraphicsContext& destContext, const FloatRect& d > // Fill with the generated image. > imageBuffer->context().fillRect(FloatRect(FloatPoint(), adjustedSize), m_gradient.get()); > >- m_cachedGeneratorHash = generatorHash; >+ m_cachedGeneratorStopsSize = generatorStopsSize; > m_cachedAdjustedSize = adjustedSize; > m_cachedScaleFactor = destContext.scaleFactor(); > >diff --git a/Source/WebCore/platform/graphics/GradientImage.h b/Source/WebCore/platform/graphics/GradientImage.h >index 0cc18439c147f934dde1930748da70c3fb175a7b..e7be728ecca2ac324c949b61050def15659c15a3 100644 >--- a/Source/WebCore/platform/graphics/GradientImage.h >+++ b/Source/WebCore/platform/graphics/GradientImage.h >@@ -54,7 +54,7 @@ private: > Ref<Gradient> m_gradient; > RefPtr<Image> m_cachedImage; > FloatSize m_cachedAdjustedSize; >- unsigned m_cachedGeneratorHash; >+ size_t m_cachedGeneratorStopsSize { 0 }; > FloatSize m_cachedScaleFactor; > }; > >diff --git a/Source/WebCore/platform/graphics/GraphicsContext.cpp b/Source/WebCore/platform/graphics/GraphicsContext.cpp >index 784477a2efaa62391a6f80c0d941d288486a53f3..c40bae3e23927651237c0323379edf3663c4d4c2 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext.cpp >+++ b/Source/WebCore/platform/graphics/GraphicsContext.cpp >@@ -211,13 +211,13 @@ void GraphicsContextStateChange::accumulate(const GraphicsContextState& state, G > void GraphicsContextStateChange::apply(GraphicsContext& context) const > { > if (m_changeFlags.contains(GraphicsContextState::StrokeGradientChange)) >- context.setStrokeGradient(*m_state.strokeGradient); >+ context.setStrokeGradient(*m_state.strokeGradient, m_state.strokeGradientPaintingData); > > if (m_changeFlags.contains(GraphicsContextState::StrokePatternChange)) > context.setStrokePattern(*m_state.strokePattern); > > if (m_changeFlags.contains(GraphicsContextState::FillGradientChange)) >- context.setFillGradient(*m_state.fillGradient); >+ context.setFillGradient(*m_state.fillGradient, m_state.fillGradientPaintingData); > > if (m_changeFlags.contains(GraphicsContextState::FillPatternChange)) > context.setFillPattern(*m_state.fillPattern); >@@ -620,10 +620,11 @@ void GraphicsContext::setFillPattern(Ref<Pattern>&& pattern) > m_impl->updateState(m_state, GraphicsContextState::FillPatternChange); > } > >-void GraphicsContext::setStrokeGradient(Ref<Gradient>&& gradient) >+void GraphicsContext::setStrokeGradient(Ref<Gradient>&& gradient, const Gradient::PaintingData& paintingData) > { > m_state.strokeColor = { }; > m_state.strokeGradient = WTFMove(gradient); >+ m_state.strokeGradientPaintingData = paintingData; > m_state.strokePattern = nullptr; > if (m_impl) > m_impl->updateState(m_state, GraphicsContextState::StrokeGradientChange); >@@ -636,10 +637,11 @@ void GraphicsContext::setFillRule(WindRule fillRule) > m_impl->updateState(m_state, GraphicsContextState::FillRuleChange); > } > >-void GraphicsContext::setFillGradient(Ref<Gradient>&& gradient) >+void GraphicsContext::setFillGradient(Ref<Gradient>&& gradient, const Gradient::PaintingData& paintingData) > { > m_state.fillColor = { }; > m_state.fillGradient = WTFMove(gradient); >+ m_state.fillGradientPaintingData = paintingData; > m_state.fillPattern = nullptr; > if (m_impl) > m_impl->updateState(m_state, GraphicsContextState::FillGradientChange); // FIXME: also fill pattern? >diff --git a/Source/WebCore/platform/graphics/GraphicsContext.h b/Source/WebCore/platform/graphics/GraphicsContext.h >index 25c6644f1297fc47c3872eb5d58eb2f0de41b556..32083d1fc7d22dcb62d6324ce3f88a7e9c118e4d 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext.h >+++ b/Source/WebCore/platform/graphics/GraphicsContext.h >@@ -30,6 +30,7 @@ > #include "DashArray.h" > #include "FloatRect.h" > #include "FontCascade.h" >+#include "Gradient.h" > #include "GraphicsTypes.h" > #include "Image.h" > #include "ImageOrientation.h" >@@ -87,7 +88,6 @@ class GlyphBuffer; > > class AffineTransform; > class FloatRoundedRect; >-class Gradient; > class GraphicsContextImpl; > class GraphicsContextPlatformPrivate; > class ImageBuffer; >@@ -212,6 +212,9 @@ struct GraphicsContextState { > Color fillColor { Color::black }; > Color shadowColor; > >+ Gradient::PaintingData strokeGradientPaintingData; >+ Gradient::PaintingData fillGradientPaintingData; >+ > StrokeStyle strokeStyle { SolidStroke }; > WindRule fillRule { WindRule::NonZero }; > >@@ -303,7 +306,7 @@ public: > void setStrokePattern(Ref<Pattern>&&); > Pattern* strokePattern() const { return m_state.strokePattern.get(); } > >- void setStrokeGradient(Ref<Gradient>&&); >+ void setStrokeGradient(Ref<Gradient>&&, const Gradient::PaintingData& = { }); > Gradient* strokeGradient() const { return m_state.strokeGradient.get(); } > > void setFillRule(WindRule); >@@ -315,7 +318,7 @@ public: > void setFillPattern(Ref<Pattern>&&); > Pattern* fillPattern() const { return m_state.fillPattern.get(); } > >- WEBCORE_EXPORT void setFillGradient(Ref<Gradient>&&); >+ WEBCORE_EXPORT void setFillGradient(Ref<Gradient>&&, const Gradient::PaintingData& = { }); > Gradient* fillGradient() const { return m_state.fillGradient.get(); } > > void setShadowsIgnoreTransforms(bool); >diff --git a/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp b/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp >index 9771290f436206eb8530f2584eb8e3cfd7a9a519..627c7487507ff0b765642bc59e2c76287811b295 100644 >--- a/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp >+++ b/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp >@@ -572,9 +572,9 @@ FillSource::FillSource(const GraphicsContextState& state) > pattern.repeatX = state.fillPattern->repeatX(); > pattern.repeatY = state.fillPattern->repeatY(); > } else if (state.fillGradient) { >- gradient.base = state.fillGradient->createPattern(1); >+ gradient.base = state.fillGradient->createPattern(1, state.fillGradientPaintingData.spreadMethod); > if (state.alpha != 1) >- gradient.alphaAdjusted = state.fillGradient->createPattern(state.alpha); >+ gradient.alphaAdjusted = state.fillGradient->createPattern(state.alpha, state.fillGradientPaintingData.spreadMethod); > } else > color = state.fillColor; > } >@@ -585,9 +585,9 @@ StrokeSource::StrokeSource(const GraphicsContextState& state) > if (state.strokePattern) > pattern = adoptRef(state.strokePattern->createPlatformPattern(AffineTransform())); > else if (state.strokeGradient) { >- gradient.base = state.strokeGradient->createPattern(1); >+ gradient.base = state.strokeGradient->createPattern(1, state.strokeGradientPaintingData.spreadMethod); > if (state.alpha != 1) >- gradient.alphaAdjusted = state.strokeGradient->createPattern(state.alpha); >+ gradient.alphaAdjusted = state.strokeGradient->createPattern(state.alpha, state.strokeGradientPaintingData.spreadMethod); > } else > color = state.strokeColor; > } >diff --git a/Source/WebCore/platform/graphics/cairo/GradientCairo.cpp b/Source/WebCore/platform/graphics/cairo/GradientCairo.cpp >index ebb6540230e33eb9e2262f6b5a8ae7374daa12db..360f75561f3a98325cce448ae4acf00f23097051 100644 >--- a/Source/WebCore/platform/graphics/cairo/GradientCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/GradientCairo.cpp >@@ -158,7 +158,7 @@ static RefPtr<cairo_pattern_t> createConic(float xo, float yo, float r, float an > return gradient; > } > >-RefPtr<cairo_pattern_t> Gradient::createPattern(float globalAlpha) >+RefPtr<cairo_pattern_t> Gradient::createPattern(float globalAlpha, GradientSpreadMethod spreadMethod) > { > auto gradient = WTF::switchOn(m_data, > [&] (const LinearData& data) { >@@ -183,7 +183,7 @@ RefPtr<cairo_pattern_t> Gradient::createPattern(float globalAlpha) > } > ); > >- switch (m_spreadMethod) { >+ switch (spreadMethod) { > case GradientSpreadMethod::Pad: > cairo_pattern_set_extend(gradient.get(), CAIRO_EXTEND_PAD); > break; >@@ -204,7 +204,7 @@ RefPtr<cairo_pattern_t> Gradient::createPattern(float globalAlpha) > > void Gradient::fill(GraphicsContext& context, const FloatRect& rect) > { >- auto pattern = createPattern(1.0); >+ auto pattern = createPattern(1.0, context.state().fillGradientPaintingData.spreadMethod); > if (!pattern) > return; > >diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp b/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp >index 146a5ecad505145c9f89506ec8db0577236eb3f7..ac918b0f8ba96e1fb16d90de76a3246ccbeba7fa 100644 >--- a/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/GraphicsContextImplCairo.cpp >@@ -154,7 +154,8 @@ void GraphicsContextImplCairo::fillRect(const FloatRect& rect, const Color& colo > > void GraphicsContextImplCairo::fillRect(const FloatRect& rect, Gradient& gradient) > { >- auto pattern = gradient.createPattern(1.0); >+ auto& state = graphicsContext().state(); >+ auto pattern = gradient.createPattern(1.0, state.fillGradientPaintingData.spreadMethod); > if (!pattern) > return; > >diff --git a/Source/WebCore/platform/graphics/cg/GradientCG.cpp b/Source/WebCore/platform/graphics/cg/GradientCG.cpp >index 81092b8e79f53fbb83c8f5a6a77212f04535b657..c8a7e7310e07fb8ba2084358253721ee649f6f97 100644 >--- a/Source/WebCore/platform/graphics/cg/GradientCG.cpp >+++ b/Source/WebCore/platform/graphics/cg/GradientCG.cpp >@@ -91,10 +91,10 @@ void Gradient::fill(GraphicsContext& context, const FloatRect& rect) > > void Gradient::paint(GraphicsContext& context) > { >- paint(context.platformContext()); >+ paint(context.platformContext(), context.state().fillGradientPaintingData.spreadMethod); > } > >-void Gradient::paint(CGContextRef platformContext) >+void Gradient::paint(CGContextRef platformContext, GradientSpreadMethod spreadMethod) > { > CGGradientDrawingOptions extendOptions = kCGGradientDrawsBeforeStartLocation | kCGGradientDrawsAfterEndLocation; > >@@ -103,7 +103,7 @@ void Gradient::paint(CGContextRef platformContext) > > WTF::switchOn(m_data, > [&] (const LinearData& data) { >- switch (m_spreadMethod) { >+ switch (spreadMethod) { > case GradientSpreadMethod::Repeat: > case GradientSpreadMethod::Reflect: { > CGContextStateSaver saveState(platformContext); >@@ -128,7 +128,7 @@ void Gradient::paint(CGContextRef platformContext) > > CGFloat gradientStart = point0.x(); > CGFloat gradientEnd = point1.x(); >- bool flip = m_spreadMethod == GradientSpreadMethod::Reflect; >+ bool flip = spreadMethod == GradientSpreadMethod::Reflect; > > // Find first gradient position to the left of the bounding box > int n = CGFloor((boundingBox.origin.x - gradientStart) / width); >@@ -144,7 +144,7 @@ void Gradient::paint(CGContextRef platformContext) > > CGContextDrawLinearGradient(platformContext, m_gradient.get(), left, right, extendOptions); > >- if (m_spreadMethod == GradientSpreadMethod::Reflect) >+ if (spreadMethod == GradientSpreadMethod::Reflect) > flip = !flip; > } > >diff --git a/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp b/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >index 8824c72843e27274ff4a388c05cd53192e63a90b..747257bd89e442315005bdf18415a609e30495f4 100644 >--- a/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >+++ b/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp >@@ -749,21 +749,21 @@ void GraphicsContext::fillPath(const Path& path) > CGContextTranslateCTM(layerContext, -rect.x(), -rect.y()); > CGContextBeginPath(layerContext); > CGContextAddPath(layerContext, path.platformPath()); >- CGContextConcatCTM(layerContext, m_state.fillGradient->gradientSpaceTransform()); >+ CGContextConcatCTM(layerContext, m_state.fillGradientPaintingData.spaceTransform); > > if (fillRule() == WindRule::EvenOdd) > CGContextEOClip(layerContext); > else > CGContextClip(layerContext); > >- m_state.fillGradient->paint(layerContext); >+ m_state.fillGradient->paint(layerContext, m_state.fillGradientPaintingData.spreadMethod); > CGContextDrawLayerInRect(context, rect, layer); > CGLayerRelease(layer); > } else { > CGContextBeginPath(context); > CGContextAddPath(context, path.platformPath()); > CGContextStateSaver stateSaver(context); >- CGContextConcatCTM(context, m_state.fillGradient->gradientSpaceTransform()); >+ CGContextConcatCTM(context, m_state.fillGradientPaintingData.spaceTransform); > > if (fillRule() == WindRule::EvenOdd) > CGContextEOClip(context); >@@ -827,8 +827,8 @@ void GraphicsContext::strokePath(const Path& path) > CGContextAddPath(layerContext, path.platformPath()); > CGContextReplacePathWithStrokedPath(layerContext); > CGContextClip(layerContext); >- CGContextConcatCTM(layerContext, m_state.strokeGradient->gradientSpaceTransform()); >- m_state.strokeGradient->paint(layerContext); >+ CGContextConcatCTM(layerContext, m_state.strokeGradientPaintingData.spaceTransform); >+ m_state.strokeGradient->paint(layerContext, m_state.strokeGradientPaintingData.spreadMethod); > > float destinationX = roundf(rect.x() - lineWidth); > float destinationY = roundf(rect.y() - lineWidth); >@@ -840,7 +840,7 @@ void GraphicsContext::strokePath(const Path& path) > CGContextAddPath(context, path.platformPath()); > CGContextReplacePathWithStrokedPath(context); > CGContextClip(context); >- CGContextConcatCTM(context, m_state.strokeGradient->gradientSpaceTransform()); >+ CGContextConcatCTM(context, m_state.strokeGradientPaintingData.spaceTransform); > m_state.strokeGradient->paint(*this); > } > return; >@@ -892,13 +892,13 @@ void GraphicsContext::fillRect(const FloatRect& rect) > CGContextAddRect(layerContext, rect); > CGContextClip(layerContext); > >- CGContextConcatCTM(layerContext, m_state.fillGradient->gradientSpaceTransform()); >- m_state.fillGradient->paint(layerContext); >+ CGContextConcatCTM(layerContext, m_state.fillGradientPaintingData.spaceTransform); >+ m_state.fillGradient->paint(layerContext, m_state.fillGradientPaintingData.spreadMethod); > CGContextDrawLayerInRect(context, rect, layer); > CGLayerRelease(layer); > } else { > CGContextClipToRect(context, rect); >- CGContextConcatCTM(context, m_state.fillGradient->gradientSpaceTransform()); >+ CGContextConcatCTM(context, m_state.fillGradientPaintingData.spaceTransform); > m_state.fillGradient->paint(*this); > } > return; >@@ -1310,8 +1310,8 @@ void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth) > CGContextAddRect(layerContext, rect); > CGContextReplacePathWithStrokedPath(layerContext); > CGContextClip(layerContext); >- CGContextConcatCTM(layerContext, m_state.strokeGradient->gradientSpaceTransform()); >- m_state.strokeGradient->paint(layerContext); >+ CGContextConcatCTM(layerContext, m_state.strokeGradientPaintingData.spaceTransform); >+ m_state.strokeGradient->paint(layerContext, m_state.strokeGradientPaintingData.spreadMethod); > > const float destinationX = roundf(rect.x() - lineWidth); > const float destinationY = roundf(rect.y() - lineWidth); >@@ -1323,7 +1323,7 @@ void GraphicsContext::strokeRect(const FloatRect& rect, float lineWidth) > CGContextAddRect(context, rect); > CGContextReplacePathWithStrokedPath(context); > CGContextClip(context); >- CGContextConcatCTM(context, m_state.strokeGradient->gradientSpaceTransform()); >+ CGContextConcatCTM(context, m_state.strokeGradientPaintingData.spaceTransform); > m_state.strokeGradient->paint(*this); > } > return; >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListDrawGlyphsRecorder.h b/Source/WebCore/platform/graphics/displaylists/DisplayListDrawGlyphsRecorder.h >index 2c7f2adf5a894fbd08513b88febbe8a7087f69e1..1f8a9c0664302482d19cf6ca8fce451ea830ccf2 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListDrawGlyphsRecorder.h >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListDrawGlyphsRecorder.h >@@ -98,6 +98,7 @@ private: > struct Style { > Color color; > RefPtr<Gradient> gradient; >+ Gradient::PaintingData gradientPaintingData; > RefPtr<Pattern> pattern; > }; > Style fillStyle; >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp >index d0fe5ebcf54dd6e3c50afbe1f7fadfe8f79880bf..3e42cfc2026e770b97084c4bd9699e8e769ef8b8 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListDrawGlyphsRecorderCoreText.cpp >@@ -98,10 +98,12 @@ void DrawGlyphsRecorder::populateInternalState(const GraphicsContextState& conte > { > m_originalState.fillStyle.color = contextState.fillColor; > m_originalState.fillStyle.gradient = contextState.fillGradient; >+ m_originalState.fillStyle.gradientPaintingData = contextState.fillGradientPaintingData; > m_originalState.fillStyle.pattern = contextState.fillPattern; > > m_originalState.strokeStyle.color = contextState.strokeColor; > m_originalState.strokeStyle.gradient = contextState.strokeGradient; >+ m_originalState.strokeStyle.gradientPaintingData = contextState.strokeGradientPaintingData; > m_originalState.strokeStyle.pattern = contextState.strokePattern; > > m_originalState.ctm = m_owner.currentState().ctm; // FIXME: Deal with base CTM. >@@ -119,7 +121,7 @@ void DrawGlyphsRecorder::populateInternalContext(const GraphicsContextState& con > if (m_originalState.fillStyle.color.isValid()) > m_internalContext.setFillColor(m_originalState.fillStyle.color); > else if (m_originalState.fillStyle.gradient) >- m_internalContext.setFillGradient(*m_originalState.fillStyle.gradient); >+ m_internalContext.setFillGradient(*m_originalState.fillStyle.gradient, m_originalState.fillStyle.gradientPaintingData); > else { > ASSERT(m_originalState.fillStyle.pattern); > if (m_originalState.fillStyle.pattern) >@@ -129,7 +131,7 @@ void DrawGlyphsRecorder::populateInternalContext(const GraphicsContextState& con > if (m_originalState.strokeStyle.color.isValid()) > m_internalContext.setStrokeColor(m_originalState.strokeStyle.color); > else if (m_originalState.strokeStyle.gradient) >- m_internalContext.setStrokeGradient(*m_originalState.strokeStyle.gradient); >+ m_internalContext.setStrokeGradient(*m_originalState.strokeStyle.gradient, m_originalState.strokeStyle.gradientPaintingData); > else { > ASSERT(m_originalState.strokeStyle.pattern); > if (m_originalState.strokeStyle.pattern) >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp >index 2325963c99bb8bccd8f2772f6c7f28dc85ac95e3..2fdbc9679f9930240b2fbda87fde3c9a3cf55165 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp >@@ -115,10 +115,9 @@ static TextStream& operator<<(TextStream& ts, const ConcatenateCTM& item) > return ts; > } > >-SetInlineFillGradient::SetInlineFillGradient(const Gradient& gradient) >+SetInlineFillGradient::SetInlineFillGradient(const Gradient& gradient, const Gradient::PaintingData& paintingData) > : m_data(gradient.data()) >- , m_gradientSpaceTransformation(gradient.gradientSpaceTransform()) >- , m_spreadMethod(gradient.spreadMethod()) >+ , m_paintingData(paintingData) > , m_colorStopCount(static_cast<uint8_t>(gradient.stops().size())) > { > RELEASE_ASSERT(m_colorStopCount <= maxColorStopCount); >@@ -128,20 +127,9 @@ SetInlineFillGradient::SetInlineFillGradient(const Gradient& gradient) > } > } > >-Ref<Gradient> SetInlineFillGradient::gradient() const >-{ >- auto gradient = Gradient::create(Gradient::Data(m_data)); >- for (uint8_t i = 0; i < m_colorStopCount; ++i) >- gradient->addColorStop({ m_offsets[i], Color(m_colors[i]) }); >- gradient->setSpreadMethod(m_spreadMethod); >- gradient->setGradientSpaceTransform(m_gradientSpaceTransformation); >- return gradient; >-} >- >-SetInlineFillGradient::SetInlineFillGradient(float offsets[maxColorStopCount], SRGBA<uint8_t> colors[maxColorStopCount], const Gradient::Data& data, const AffineTransform& gradientSpaceTransformation, GradientSpreadMethod spreadMethod, uint8_t colorStopCount) >+SetInlineFillGradient::SetInlineFillGradient(float offsets[maxColorStopCount], SRGBA<uint8_t> colors[maxColorStopCount], const Gradient::Data& data, const Gradient::PaintingData& paintingData, uint8_t colorStopCount) > : m_data(data) >- , m_gradientSpaceTransformation(gradientSpaceTransformation) >- , m_spreadMethod(spreadMethod) >+ , m_paintingData(paintingData) > , m_colorStopCount(colorStopCount) > { > RELEASE_ASSERT(m_colorStopCount <= maxColorStopCount); >@@ -151,10 +139,18 @@ SetInlineFillGradient::SetInlineFillGradient(float offsets[maxColorStopCount], S > } > } > >+Ref<Gradient> SetInlineFillGradient::gradient() const >+{ >+ auto gradient = Gradient::create(Gradient::Data(m_data)); >+ for (uint8_t i = 0; i < m_colorStopCount; ++i) >+ gradient->addColorStop({ m_offsets[i], Color(m_colors[i]) }); >+ return gradient; >+} >+ > void SetInlineFillGradient::apply(GraphicsContext& context) const > { > if (m_colorStopCount <= maxColorStopCount) >- context.setFillGradient(gradient()); >+ context.setFillGradient(gradient(), m_paintingData); > } > > bool SetInlineFillGradient::isInline(const Gradient& gradient) >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h >index ea8acade657514013080f271bd72befd311510a8..eeded04b37221710428501029bf0b33210c6d974 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h >@@ -174,9 +174,8 @@ public: > static constexpr bool isDrawingItem = false; > static constexpr uint8_t maxColorStopCount = 4; > >- SetInlineFillGradient(const Gradient&); >- WEBCORE_EXPORT SetInlineFillGradient(float offsets[maxColorStopCount], SRGBA<uint8_t> colors[maxColorStopCount], const Gradient::Data&, >- const AffineTransform& gradientSpaceTransformation, GradientSpreadMethod, uint8_t colorStopCount); >+ SetInlineFillGradient(const Gradient&, const Gradient::PaintingData&); >+ WEBCORE_EXPORT SetInlineFillGradient(float offsets[maxColorStopCount], SRGBA<uint8_t> colors[maxColorStopCount], const Gradient::Data&, const Gradient::PaintingData&, uint8_t colorStopCount); > > static bool isInline(const Gradient&); > Ref<Gradient> gradient() const; >@@ -187,8 +186,8 @@ private: > float m_offsets[maxColorStopCount]; > SRGBA<uint8_t> m_colors[maxColorStopCount]; > Gradient::Data m_data; >- AffineTransform m_gradientSpaceTransformation; >- GradientSpreadMethod m_spreadMethod { GradientSpreadMethod::Pad }; >+ >+ Gradient::PaintingData m_paintingData; > uint8_t m_colorStopCount { 0 }; > }; > >diff --git a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >index b9483df42dd90187b1f69dd91b5efb4d490b42eb..546a8954ee0fecbc56fc53844a06c45b1df033b8 100644 >--- a/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >+++ b/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp >@@ -101,7 +101,7 @@ void Recorder::appendStateChangeItem(const GraphicsContextStateChange& changes, > append<SetInlineFillColor>(changes.m_state.fillColor.asInline()); > > if (changeFlags.contains(GraphicsContextState::FillGradientChange)) >- append<SetInlineFillGradient>(*changes.m_state.fillGradient); >+ append<SetInlineFillGradient>(*changes.m_state.fillGradient, changes.m_state.fillGradientPaintingData); > } > > void Recorder::willAppendItemOfType(ItemType type) >diff --git a/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp b/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp >index 2c9aa886969eb052eec632ce9c6e9d55721f976d..013c703306436eff97ddda7f045c9d35c15c4005 100644 >--- a/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp >+++ b/Source/WebCore/platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp >@@ -292,7 +292,8 @@ void CairoOperationRecorder::fillRect(const FloatRect& rect, Gradient& gradient) > } > }; > >- append(createCommand<FillRect>(rect, gradient.createPattern(1.0))); >+ auto& state = graphicsContext().state(); >+ append(createCommand<FillRect>(rect, gradient.createPattern(1.0, state.fillGradientPaintingData.spreadMethod))); > } > > void CairoOperationRecorder::fillRect(const FloatRect& rect, const Color& color, CompositeOperator compositeOperator, BlendMode blendMode) >diff --git a/Source/WebCore/rendering/svg/RenderSVGPath.cpp b/Source/WebCore/rendering/svg/RenderSVGPath.cpp >index 04f859f15c73fb13b87f3e8988475f62a2fe5f10..4bc1d02501a2afbe1cd67a929c0c21a0cad68649 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGPath.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGPath.cpp >@@ -69,7 +69,7 @@ FloatRect RenderSVGPath::calculateUpdatedStrokeBoundingBox() const > static void useStrokeStyleToFill(GraphicsContext& context) > { > if (auto gradient = context.strokeGradient()) >- context.setFillGradient(*gradient); >+ context.setFillGradient(*gradient, context.state().strokeGradientPaintingData); > else if (Pattern* pattern = context.strokePattern()) > context.setFillPattern(*pattern); > else >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp >index d229b6313c5b380ef95fe1bbdc646fbf10e2d831..5278d6dd24f760ac03760bcce4727417e0f79e53 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp >@@ -145,8 +145,6 @@ bool RenderSVGResourceGradient::applyResource(RenderElement& renderer, const Ren > userspaceTransform *= additionalTextTransform; > } > >- gradient->setGradientSpaceTransform(userspaceTransform); >- > return { WTFMove(gradient), userspaceTransform }; > }).iterator->value; > >@@ -164,16 +162,17 @@ bool RenderSVGResourceGradient::applyResource(RenderElement& renderer, const Ren > } > > auto& svgStyle = style.svgStyle(); >+ auto userspaceTransform = gradientData.userspaceTransform; > > if (resourceMode.contains(RenderSVGResourceMode::ApplyToFill)) { > context->setAlpha(svgStyle.fillOpacity()); >- context->setFillGradient(*gradientData.gradient); >+ context->setFillGradient(*gradientData.gradient, { platformSpreadMethodFromSVGType(spreadMethod()), userspaceTransform }); > context->setFillRule(svgStyle.fillRule()); > } else if (resourceMode.contains(RenderSVGResourceMode::ApplyToStroke)) { > if (svgStyle.vectorEffect() == VectorEffect::NonScalingStroke) >- gradientData.gradient->setGradientSpaceTransform(transformOnNonScalingStroke(&renderer, gradientData.userspaceTransform)); >+ userspaceTransform = transformOnNonScalingStroke(&renderer, gradientData.userspaceTransform); > context->setAlpha(svgStyle.strokeOpacity()); >- context->setStrokeGradient(*gradientData.gradient); >+ context->setStrokeGradient(*gradientData.gradient, { platformSpreadMethodFromSVGType(spreadMethod()), userspaceTransform }); > SVGRenderSupport::applyStrokeStyleToContext(context, style, renderer); > } > >@@ -197,9 +196,9 @@ void RenderSVGResourceGradient::postApplyResource(RenderElement& renderer, Graph > context = std::exchange(m_savedContext, nullptr); > > FloatRect targetRect; >- gradient.setGradientSpaceTransform(clipToTextMask(*context, m_imageBuffer, targetRect, &renderer, gradientUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX, gradientTransform())); >+ AffineTransform userspaceTransform = clipToTextMask(*context, m_imageBuffer, targetRect, &renderer, gradientUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX, gradientTransform()); > >- context->setFillGradient(gradient); >+ context->setFillGradient(gradient, { platformSpreadMethodFromSVGType(spreadMethod()), userspaceTransform }); > context->fillRect(targetRect); > > m_imageBuffer = nullptr; >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceGradient.h b/Source/WebCore/rendering/svg/RenderSVGResourceGradient.h >index 25f5bb01cb69935d3d574a65b0ea18e300c62206..038bde93bdb0db248568f75a74291643516bd754 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourceGradient.h >+++ b/Source/WebCore/rendering/svg/RenderSVGResourceGradient.h >@@ -52,6 +52,7 @@ protected: > private: > void element() const = delete; > >+ virtual SVGSpreadMethodType spreadMethod() const = 0; > virtual SVGUnitTypes::SVGUnitType gradientUnits() const = 0; > virtual AffineTransform gradientTransform() const = 0; > virtual bool collectGradientAttributes() = 0; >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.cpp >index a8ec1b2a94f6655da7ad32927da97c0cdc7a099c..4ecaa5aea3b27e4d878e4d15b337dc7c2c928106 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.cpp >@@ -53,7 +53,6 @@ FloatPoint RenderSVGResourceLinearGradient::endPoint(const LinearGradientAttribu > Ref<Gradient> RenderSVGResourceLinearGradient::buildGradient(const RenderStyle& style) const > { > auto gradient = Gradient::create(Gradient::LinearData { startPoint(m_attributes), endPoint(m_attributes) }); >- gradient->setSpreadMethod(platformSpreadMethodFromSVGType(m_attributes.spreadMethod())); > addStops(gradient, m_attributes.stops(), style); > return gradient; > } >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.h b/Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.h >index 558d42a57efec0a1be742902f8bf84a94610553e..a50858e97e7fee888cfb0d3786a8daefb08b635b 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.h >+++ b/Source/WebCore/rendering/svg/RenderSVGResourceLinearGradient.h >@@ -40,6 +40,7 @@ public: > private: > RenderSVGResourceType resourceType() const final { return LinearGradientResourceType; } > >+ SVGSpreadMethodType spreadMethod() const final { return m_attributes.spreadMethod(); } > SVGUnitTypes::SVGUnitType gradientUnits() const final { return m_attributes.gradientUnits(); } > AffineTransform gradientTransform() const final { return m_attributes.gradientTransform(); } > bool collectGradientAttributes() final; >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.cpp b/Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.cpp >index badf175a80649b0bc1324b8ba0726261d5f20b98..67e45410ba1370fbe0d7a0e6bff2dc979d240e13 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.cpp >@@ -64,7 +64,6 @@ float RenderSVGResourceRadialGradient::focalRadius(const RadialGradientAttribute > Ref<Gradient> RenderSVGResourceRadialGradient::buildGradient(const RenderStyle& style) const > { > auto gradient = Gradient::create(Gradient::RadialData { focalPoint(m_attributes), centerPoint(m_attributes), focalRadius(m_attributes), radius(m_attributes), 1 }); >- gradient->setSpreadMethod(platformSpreadMethodFromSVGType(m_attributes.spreadMethod())); > addStops(gradient, m_attributes.stops(), style); > return gradient; > } >diff --git a/Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.h b/Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.h >index af396d1506d6f2cc1711ddb72ef64ea6b9e374b7..bc4c4e55f910f94025171be37984f76821afdc3c 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.h >+++ b/Source/WebCore/rendering/svg/RenderSVGResourceRadialGradient.h >@@ -44,6 +44,7 @@ public: > private: > RenderSVGResourceType resourceType() const final { return RadialGradientResourceType; } > >+ SVGSpreadMethodType spreadMethod() const final { return m_attributes.spreadMethod(); } > SVGUnitTypes::SVGUnitType gradientUnits() const final { return m_attributes.gradientUnits(); } > AffineTransform gradientTransform() const final { return m_attributes.gradientTransform(); } > Ref<Gradient> buildGradient(const RenderStyle&) const final;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-feeder
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 220079
:
416650
|
416651
|
416653
|
417509