diff --git a/Userland/Libraries/LibWeb/Painting/Command.cpp b/Userland/Libraries/LibWeb/Painting/Command.cpp index 0026387fc59..cbd0a65d005 100644 --- a/Userland/Libraries/LibWeb/Painting/Command.cpp +++ b/Userland/Libraries/LibWeb/Painting/Command.cpp @@ -17,17 +17,17 @@ void DrawGlyphRun::translate_by(Gfx::IntPoint const& offset) Gfx::IntRect PaintOuterBoxShadow::bounding_rect() const { - return get_outer_box_shadow_bounding_rect(outer_box_shadow_params); + return get_outer_box_shadow_bounding_rect(box_shadow_params); } void PaintOuterBoxShadow::translate_by(Gfx::IntPoint const& offset) { - outer_box_shadow_params.device_content_rect.translate_by(offset); + box_shadow_params.device_content_rect.translate_by(offset); } void PaintInnerBoxShadow::translate_by(Gfx::IntPoint const& offset) { - outer_box_shadow_params.device_content_rect.translate_by(offset); + box_shadow_params.device_content_rect.translate_by(offset); } } diff --git a/Userland/Libraries/LibWeb/Painting/Command.h b/Userland/Libraries/LibWeb/Painting/Command.h index 7ffb9631a60..9ce66992a00 100644 --- a/Userland/Libraries/LibWeb/Painting/Command.h +++ b/Userland/Libraries/LibWeb/Painting/Command.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include namespace Web::Painting { @@ -140,14 +140,14 @@ struct PaintLinearGradient { }; struct PaintOuterBoxShadow { - PaintOuterBoxShadowParams outer_box_shadow_params; + PaintBoxShadowParams box_shadow_params; [[nodiscard]] Gfx::IntRect bounding_rect() const; void translate_by(Gfx::IntPoint const& offset); }; struct PaintInnerBoxShadow { - PaintOuterBoxShadowParams outer_box_shadow_params; + PaintBoxShadowParams box_shadow_params; void translate_by(Gfx::IntPoint const& offset); }; diff --git a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp b/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp index 6a1369fa54b..0ce7209cfc9 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp +++ b/Userland/Libraries/LibWeb/Painting/CommandExecutorCPU.cpp @@ -259,14 +259,14 @@ CommandResult CommandExecutorCPU::paint_linear_gradient(PaintLinearGradient cons CommandResult CommandExecutorCPU::paint_outer_box_shadow(PaintOuterBoxShadow const& command) { auto& painter = this->painter(); - Web::Painting::paint_outer_box_shadow(painter, command.outer_box_shadow_params); + Web::Painting::paint_outer_box_shadow(painter, command.box_shadow_params); return CommandResult::Continue; } CommandResult CommandExecutorCPU::paint_inner_box_shadow(PaintInnerBoxShadow const& command) { auto& painter = this->painter(); - Web::Painting::paint_inner_box_shadow(painter, command.outer_box_shadow_params); + Web::Painting::paint_inner_box_shadow(painter, command.box_shadow_params); return CommandResult::Continue; } diff --git a/Userland/Libraries/LibWeb/Painting/CommandList.h b/Userland/Libraries/LibWeb/Painting/CommandList.h index 90c9a13339d..fa0be67be5b 100644 --- a/Userland/Libraries/LibWeb/Painting/CommandList.h +++ b/Userland/Libraries/LibWeb/Painting/CommandList.h @@ -32,7 +32,7 @@ #include #include #include -#include +#include namespace Web::Painting { diff --git a/Userland/Libraries/LibWeb/Painting/PaintOuterBoxShadowParams.h b/Userland/Libraries/LibWeb/Painting/PaintBoxShadowParams.h similarity index 92% rename from Userland/Libraries/LibWeb/Painting/PaintOuterBoxShadowParams.h rename to Userland/Libraries/LibWeb/Painting/PaintBoxShadowParams.h index 5ec1fb83ce7..cd66084a64e 100644 --- a/Userland/Libraries/LibWeb/Painting/PaintOuterBoxShadowParams.h +++ b/Userland/Libraries/LibWeb/Painting/PaintBoxShadowParams.h @@ -11,7 +11,7 @@ namespace Web::Painting { -struct PaintOuterBoxShadowParams { +struct PaintBoxShadowParams { Gfx::Color color; ShadowPlacement placement; CornerRadii corner_radii; diff --git a/Userland/Libraries/LibWeb/Painting/RecordingPainter.cpp b/Userland/Libraries/LibWeb/Painting/RecordingPainter.cpp index d4e3c627875..dd259cb1711 100644 --- a/Userland/Libraries/LibWeb/Painting/RecordingPainter.cpp +++ b/Userland/Libraries/LibWeb/Painting/RecordingPainter.cpp @@ -342,19 +342,15 @@ void RecordingPainter::apply_backdrop_filter(Gfx::IntRect const& backdrop_region }); } -void RecordingPainter::paint_outer_box_shadow_params(PaintOuterBoxShadowParams params) +void RecordingPainter::paint_outer_box_shadow_params(PaintBoxShadowParams params) { params.device_content_rect = state().translation.map(params.device_content_rect); - append(PaintOuterBoxShadow { - .outer_box_shadow_params = params, - }); + append(PaintOuterBoxShadow { .box_shadow_params = params }); } -void RecordingPainter::paint_inner_box_shadow_params(PaintOuterBoxShadowParams params) +void RecordingPainter::paint_inner_box_shadow_params(PaintBoxShadowParams params) { - append(PaintInnerBoxShadow { - .outer_box_shadow_params = params, - }); + append(PaintInnerBoxShadow { .box_shadow_params = params }); } void RecordingPainter::paint_text_shadow(int blur_radius, Gfx::IntRect bounding_rect, Gfx::IntRect text_rect, Span glyph_run, Color color, int fragment_baseline, Gfx::IntPoint draw_location) diff --git a/Userland/Libraries/LibWeb/Painting/RecordingPainter.h b/Userland/Libraries/LibWeb/Painting/RecordingPainter.h index a4d765d54f2..f735bf85011 100644 --- a/Userland/Libraries/LibWeb/Painting/RecordingPainter.h +++ b/Userland/Libraries/LibWeb/Painting/RecordingPainter.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include namespace Web::Painting { @@ -130,8 +130,8 @@ public: void apply_backdrop_filter(Gfx::IntRect const& backdrop_region, BorderRadiiData const& border_radii_data, CSS::ResolvedBackdropFilter const& backdrop_filter); - void paint_outer_box_shadow_params(PaintOuterBoxShadowParams params); - void paint_inner_box_shadow_params(PaintOuterBoxShadowParams params); + void paint_outer_box_shadow_params(PaintBoxShadowParams params); + void paint_inner_box_shadow_params(PaintBoxShadowParams params); void paint_text_shadow(int blur_radius, Gfx::IntRect bounding_rect, Gfx::IntRect text_rect, Span glyph_run, Color color, int fragment_baseline, Gfx::IntPoint draw_location); void fill_rect_with_rounded_corners(Gfx::IntRect const& rect, Color color, Gfx::AntiAliasingPainter::CornerRadius top_left_radius, Gfx::AntiAliasingPainter::CornerRadius top_right_radius, Gfx::AntiAliasingPainter::CornerRadius bottom_right_radius, Gfx::AntiAliasingPainter::CornerRadius bottom_left_radius, Vector const& clip_paths = {}); diff --git a/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp b/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp index 27fc07ed9a8..86d3822ed76 100644 --- a/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp +++ b/Userland/Libraries/LibWeb/Painting/ShadowPainting.cpp @@ -15,14 +15,14 @@ #include #include #include +#include #include -#include #include #include namespace Web::Painting { -void paint_inner_box_shadow(Gfx::Painter& painter, PaintOuterBoxShadowParams params) +void paint_inner_box_shadow(Gfx::Painter& painter, PaintBoxShadowParams params) { auto device_content_rect = params.device_content_rect; @@ -112,7 +112,7 @@ struct OuterBoxShadowMetrics { CornerRadius bottom_left_shadow_corner; }; -static OuterBoxShadowMetrics get_outer_box_shadow_configuration(PaintOuterBoxShadowParams params) +static OuterBoxShadowMetrics get_outer_box_shadow_configuration(PaintBoxShadowParams params) { auto device_content_rect = params.device_content_rect; @@ -288,7 +288,7 @@ static OuterBoxShadowMetrics get_outer_box_shadow_configuration(PaintOuterBoxSha }; } -Gfx::IntRect get_outer_box_shadow_bounding_rect(PaintOuterBoxShadowParams params) +Gfx::IntRect get_outer_box_shadow_bounding_rect(PaintBoxShadowParams params) { auto shadow_config = get_outer_box_shadow_configuration(params); @@ -305,7 +305,7 @@ Gfx::IntRect get_outer_box_shadow_bounding_rect(PaintOuterBoxShadowParams params }; } -void paint_outer_box_shadow(Gfx::Painter& painter, PaintOuterBoxShadowParams params) +void paint_outer_box_shadow(Gfx::Painter& painter, PaintBoxShadowParams params) { auto const& device_content_rect = params.device_content_rect; @@ -550,7 +550,7 @@ void paint_box_shadow(PaintContext& context, device_content_rect = context.rounded_device_rect(bordered_content_rect); } - auto params = PaintOuterBoxShadowParams { + auto params = PaintBoxShadowParams { .color = box_shadow_data.color, .placement = box_shadow_data.placement, .corner_radii = CornerRadii { diff --git a/Userland/Libraries/LibWeb/Painting/ShadowPainting.h b/Userland/Libraries/LibWeb/Painting/ShadowPainting.h index 37b8c0c1447..61f1a331dc1 100644 --- a/Userland/Libraries/LibWeb/Painting/ShadowPainting.h +++ b/Userland/Libraries/LibWeb/Painting/ShadowPainting.h @@ -8,17 +8,17 @@ #include #include +#include #include -#include #include #include namespace Web::Painting { -void paint_inner_box_shadow(Gfx::Painter&, PaintOuterBoxShadowParams params); +void paint_inner_box_shadow(Gfx::Painter&, PaintBoxShadowParams params); -Gfx::IntRect get_outer_box_shadow_bounding_rect(PaintOuterBoxShadowParams params); -void paint_outer_box_shadow(Gfx::Painter& painter, PaintOuterBoxShadowParams params); +Gfx::IntRect get_outer_box_shadow_bounding_rect(PaintBoxShadowParams params); +void paint_outer_box_shadow(Gfx::Painter& painter, PaintBoxShadowParams params); void paint_box_shadow( PaintContext&,