|
@@ -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<SVGRadialGradientPaintStyle>(paint_style)) {
|
|
|
// TODO:
|