From 566870b2bd4cf627dfae6573eae765cf1794fa58 Mon Sep 17 00:00:00 2001 From: Pavel Shliak Date: Mon, 11 Nov 2024 14:19:27 +0400 Subject: [PATCH] LibWeb: Reduce PaintTextShadow struct from 72 to 64 bytes --- Libraries/LibWeb/Painting/Command.h | 8 ++++---- Libraries/LibWeb/Painting/DisplayListRecorder.cpp | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Libraries/LibWeb/Painting/Command.h b/Libraries/LibWeb/Painting/Command.h index d02bd9dd532..fca91076711 100644 --- a/Libraries/LibWeb/Painting/Command.h +++ b/Libraries/LibWeb/Painting/Command.h @@ -158,13 +158,13 @@ struct PaintInnerBoxShadow { }; struct PaintTextShadow { - int blur_radius; - Gfx::IntRect shadow_bounding_rect; - Gfx::IntRect text_rect; NonnullRefPtr glyph_run; double glyph_run_scale { 1 }; - Color color; + Gfx::IntRect shadow_bounding_rect; + Gfx::IntRect text_rect; Gfx::IntPoint draw_location; + int blur_radius; + Color color; [[nodiscard]] Gfx::IntRect bounding_rect() const { return { draw_location, shadow_bounding_rect.size() }; } void translate_by(Gfx::IntPoint const& offset) { draw_location.translate_by(offset); } diff --git a/Libraries/LibWeb/Painting/DisplayListRecorder.cpp b/Libraries/LibWeb/Painting/DisplayListRecorder.cpp index c8459328b42..44385334af5 100644 --- a/Libraries/LibWeb/Painting/DisplayListRecorder.cpp +++ b/Libraries/LibWeb/Painting/DisplayListRecorder.cpp @@ -325,13 +325,13 @@ void DisplayListRecorder::paint_inner_box_shadow_params(PaintBoxShadowParams par void DisplayListRecorder::paint_text_shadow(int blur_radius, Gfx::IntRect bounding_rect, Gfx::IntRect text_rect, Gfx::GlyphRun const& glyph_run, double glyph_run_scale, Color color, Gfx::IntPoint draw_location) { append(PaintTextShadow { - .blur_radius = blur_radius, - .shadow_bounding_rect = bounding_rect, - .text_rect = text_rect, .glyph_run = glyph_run, .glyph_run_scale = glyph_run_scale, - .color = color, - .draw_location = draw_location }); + .shadow_bounding_rect = bounding_rect, + .text_rect = text_rect, + .draw_location = draw_location, + .blur_radius = blur_radius, + .color = color }); } void DisplayListRecorder::fill_rect_with_rounded_corners(Gfx::IntRect const& rect, Color color, Gfx::CornerRadius top_left_radius, Gfx::CornerRadius top_right_radius, Gfx::CornerRadius bottom_right_radius, Gfx::CornerRadius bottom_left_radius)