mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibWeb: Add support for conic gradient transition hints in Skia painter
This commit is contained in:
parent
f63a945ba0
commit
761fa97fef
Notes:
sideshowbarker
2024-07-18 00:41:35 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/LadybirdBrowser/ladybird/commit/761fa97fef Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/642
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue