From 761fa97fef90a139cbc4fe598b039a2018912935 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Mon, 15 Jul 2024 13:44:57 +0300 Subject: [PATCH] LibWeb: Add support for conic gradient transition hints in Skia painter --- .../Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp index 5f1214e4c9a..4a43adadc4b 100644 --- a/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp +++ b/Userland/Libraries/LibWeb/Painting/DisplayListPlayerSkia.cpp @@ -1167,10 +1167,14 @@ CommandResult DisplayListPlayerSkia::paint_conic_gradient(PaintConicGradient con auto const& color_stop_list = conic_gradient_data.color_stops.list; VERIFY(!color_stop_list.is_empty()); + auto stops_with_replaced_transition_hints = replace_transition_hints_with_normal_color_stops(color_stop_list); Vector colors; Vector positions; - for (auto const& stop : color_stop_list) { + for (size_t stop_index = 0; stop_index < stops_with_replaced_transition_hints.size(); stop_index++) { + auto const& stop = stops_with_replaced_transition_hints[stop_index]; + if (stop_index > 0 && stop == stops_with_replaced_transition_hints[stop_index - 1]) + continue; colors.append(to_skia_color(stop.color)); positions.append(stop.position); }