LibWeb: Merge StrokePathUsingPaintStyle and StrokePathUsingColor

Use `Variant<PaintStyle, Gfx::Color>` in new `StrokePath` instead of
duplicating two almost identical display list items.
This commit is contained in:
Aliaksandr Kalenik 2025-08-02 20:04:12 +02:00 committed by Jelle Raaijmakers
commit 5c11a541d3
Notes: github-actions[bot] 2025-08-03 08:43:52 +00:00
12 changed files with 37 additions and 114 deletions

View file

@ -176,9 +176,9 @@ void SVGPathPaintable::paint(DisplayListRecordingContext& context, PaintPhase ph
.dash_array = stroke_dasharray,
.dash_offset = stroke_dashoffset,
.path = path,
.paint_style = *paint_style,
.thickness = stroke_thickness,
.opacity = stroke_opacity,
.paint_style_or_color = *paint_style,
.thickness = stroke_thickness,
.translation = offset,
});
} else if (auto stroke_color = graphics_element.stroke_color(); stroke_color.has_value()) {
@ -189,7 +189,7 @@ void SVGPathPaintable::paint(DisplayListRecordingContext& context, PaintPhase ph
.dash_array = stroke_dasharray,
.dash_offset = stroke_dashoffset,
.path = path,
.color = stroke_color->with_opacity(stroke_opacity),
.paint_style_or_color = stroke_color->with_opacity(stroke_opacity),
.thickness = stroke_thickness,
.translation = offset,
});