diff --git a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp index f3f46854483..011cb624e42 100644 --- a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp @@ -786,6 +786,20 @@ CommandResult DisplayListPlayerSkia::fill_path_using_color(FillPathUsingColor co return CommandResult::Continue; } +SkTileMode to_skia_tile_mode(SVGLinearGradientPaintStyle::SpreadMethod spread_method) +{ + switch (spread_method) { + case SVGLinearGradientPaintStyle::SpreadMethod::Pad: + return SkTileMode::kClamp; + case SVGLinearGradientPaintStyle::SpreadMethod::Reflect: + return SkTileMode::kMirror; + case SVGLinearGradientPaintStyle::SpreadMethod::Repeat: + return SkTileMode::kRepeat; + default: + VERIFY_NOT_REACHED(); + } +} + SkPaint paint_style_to_skia_paint(Painting::SVGGradientPaintStyle const& paint_style, Gfx::FloatRect bounding_rect) { SkPaint paint; @@ -816,7 +830,7 @@ SkPaint paint_style_to_skia_paint(Painting::SVGGradientPaintStyle const& paint_s positions.append(color_stop.position); } - auto shader = SkGradientShader::MakeLinear(points.data(), colors.data(), positions.data(), color_stops.size(), SkTileMode::kClamp, 0, &matrix); + auto shader = SkGradientShader::MakeLinear(points.data(), colors.data(), positions.data(), color_stops.size(), to_skia_tile_mode(paint_style.spread_method()), 0, &matrix); paint.setShader(shader); } else if (is(paint_style)) { // TODO: