diff options
author | MacDue <macdue@dueutil.tech> | 2023-01-29 13:28:36 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-01-29 13:49:35 +0000 |
commit | 285bd7a37a6a6328eeb8c6cffe8a1f41bb4b49ed (patch) | |
tree | e92dfd57313f2d58df215cd28aff464f0afe15c7 /Userland/Libraries/LibGfx/GradientPainting.cpp | |
parent | a75f9273b4dcb202b705b9e760b2e9609ef0dd81 (diff) | |
download | serenity-285bd7a37a6a6328eeb8c6cffe8a1f41bb4b49ed.zip |
LibGfx: Stop passing color stop spans by const reference
No idea why I did this, possibly because these were once vectors?
Anyway, the const reference is pointless here.
Diffstat (limited to 'Userland/Libraries/LibGfx/GradientPainting.cpp')
-rw-r--r-- | Userland/Libraries/LibGfx/GradientPainting.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibGfx/GradientPainting.cpp b/Userland/Libraries/LibGfx/GradientPainting.cpp index c6059945db..6d924c5531 100644 --- a/Userland/Libraries/LibGfx/GradientPainting.cpp +++ b/Userland/Libraries/LibGfx/GradientPainting.cpp @@ -165,7 +165,7 @@ private: TransformFunction m_transform_function; }; -static auto create_linear_gradient(IntRect const& physical_rect, Span<ColorStop const> const& color_stops, float angle, Optional<float> repeat_length) +static auto create_linear_gradient(IntRect const& physical_rect, Span<ColorStop const> color_stops, float angle, Optional<float> repeat_length) { float normalized_angle = normalized_gradient_angle_radians(angle); float sin_angle, cos_angle; @@ -188,7 +188,7 @@ static auto create_linear_gradient(IntRect const& physical_rect, Span<ColorStop }; } -static auto create_conic_gradient(Span<ColorStop const> const& color_stops, FloatPoint center_point, float start_angle, Optional<float> repeat_length, UsePremultipliedAlpha use_premultiplied_alpha = UsePremultipliedAlpha::Yes) +static auto create_conic_gradient(Span<ColorStop const> color_stops, FloatPoint center_point, float start_angle, Optional<float> repeat_length, UsePremultipliedAlpha use_premultiplied_alpha = UsePremultipliedAlpha::Yes) { // FIXME: Do we need/want sub-degree accuracy for the gradient line? GradientLine gradient_line(360, color_stops, repeat_length, use_premultiplied_alpha); @@ -213,7 +213,7 @@ static auto create_conic_gradient(Span<ColorStop const> const& color_stops, Floa }; } -static auto create_radial_gradient(IntRect const& physical_rect, Span<ColorStop const> const& color_stops, IntPoint center, IntSize size, Optional<float> repeat_length) +static auto create_radial_gradient(IntRect const& physical_rect, Span<ColorStop const> color_stops, IntPoint center, IntSize size, Optional<float> repeat_length) { // A conservative guesstimate on how many colors we need to generate: auto max_dimension = max(physical_rect.width(), physical_rect.height()); @@ -232,7 +232,7 @@ static auto create_radial_gradient(IntRect const& physical_rect, Span<ColorStop }; } -void Painter::fill_rect_with_linear_gradient(IntRect const& rect, Span<ColorStop const> const& color_stops, float angle, Optional<float> repeat_length) +void Painter::fill_rect_with_linear_gradient(IntRect const& rect, Span<ColorStop const> color_stops, float angle, Optional<float> repeat_length) { auto a_rect = to_physical(rect); if (a_rect.intersected(clip_rect() * scale()).is_empty()) @@ -246,7 +246,7 @@ static FloatPoint pixel_center(IntPoint point) return point.to_type<float>().translated(0.5f, 0.5f); } -void Painter::fill_rect_with_conic_gradient(IntRect const& rect, Span<ColorStop const> const& color_stops, IntPoint center, float start_angle, Optional<float> repeat_length) +void Painter::fill_rect_with_conic_gradient(IntRect const& rect, Span<ColorStop const> color_stops, IntPoint center, float start_angle, Optional<float> repeat_length) { auto a_rect = to_physical(rect); if (a_rect.intersected(clip_rect() * scale()).is_empty()) @@ -257,7 +257,7 @@ void Painter::fill_rect_with_conic_gradient(IntRect const& rect, Span<ColorStop conic_gradient.paint(*this, a_rect); } -void Painter::fill_rect_with_radial_gradient(IntRect const& rect, Span<ColorStop const> const& color_stops, IntPoint center, IntSize size, Optional<float> repeat_length) +void Painter::fill_rect_with_radial_gradient(IntRect const& rect, Span<ColorStop const> color_stops, IntPoint center, IntSize size, Optional<float> repeat_length) { auto a_rect = to_physical(rect); if (a_rect.intersected(clip_rect() * scale()).is_empty()) |