LibWeb: Add support for conic gradient transition hints in Skia painter

This commit is contained in:
Aliaksandr Kalenik 2024-07-15 13:44:57 +03:00 committed by Alexander Kalenik
parent f63a945ba0
commit 761fa97fef
Notes: sideshowbarker 2024-07-18 00:41:35 +09:00

View file

@ -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<SkColor> colors;
Vector<SkScalar> 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);
}