LibWeb: Use repeat tile mode if repeating length specified

...for radial gradient in Skia painter.
This commit is contained in:
Aliaksandr Kalenik 2024-07-16 16:43:11 +03:00 committed by Alexander Kalenik
parent fb03f36cfa
commit 4aba38e21f
Notes: sideshowbarker 2024-07-17 03:03:15 +09:00

View file

@ -1200,7 +1200,11 @@ CommandResult DisplayListPlayerSkia::paint_radial_gradient(PaintRadialGradient c
// so instead we apply scale matrix
matrix.setScale(size.width() / size.height(), 1.0f, center.x(), center.y());
auto shader = SkGradientShader::MakeRadial(center, size.height(), colors.data(), positions.data(), positions.size(), SkTileMode::kClamp, 0, &matrix);
SkTileMode tile_mode = SkTileMode::kClamp;
if (repeat_length.has_value())
tile_mode = SkTileMode::kRepeat;
auto shader = SkGradientShader::MakeRadial(center, size.height(), colors.data(), positions.data(), positions.size(), tile_mode, 0, &matrix);
SkPaint paint;
paint.setShader(shader);