mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 09:45:06 +02:00
Expand color stops during display list recording rather than playback. Recording happens once but the display list may be executed many times, so doing this work at record time is more efficient.
43 lines
866 B
C++
43 lines
866 B
C++
/*
|
|
* Copyright (c) 2023, MacDue <macdue@dueutil.tech>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Span.h>
|
|
#include <AK/Vector.h>
|
|
#include <LibGfx/Gradients.h>
|
|
#include <LibWeb/CSS/StyleValues/AbstractImageStyleValue.h>
|
|
#include <LibWeb/Forward.h>
|
|
|
|
namespace Web::Painting {
|
|
|
|
using ColorStopList = Vector<Gfx::ColorStop, 4>;
|
|
|
|
struct ColorStopData {
|
|
ColorStopList list;
|
|
Optional<float> repeat_length;
|
|
bool repeating { false };
|
|
};
|
|
|
|
struct LinearGradientData {
|
|
float gradient_angle;
|
|
ColorStopData color_stops;
|
|
CSS::InterpolationMethod interpolation_method;
|
|
};
|
|
|
|
struct ConicGradientData {
|
|
float start_angle;
|
|
ColorStopData color_stops;
|
|
CSS::InterpolationMethod interpolation_method;
|
|
};
|
|
|
|
struct RadialGradientData {
|
|
ColorStopData color_stops;
|
|
CSS::InterpolationMethod interpolation_method;
|
|
};
|
|
|
|
}
|