1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:07:34 +00:00

Meta+Userland: Pass Gfx::Color by value

Gfx::Color is always 4 bytes (it's just a wrapper over u32) it's less
work just to pass the color directly.

This also updates IPCCompiler to prevent from generating
Gfx::Color const &, which makes replacement easier.
This commit is contained in:
MacDue 2022-12-06 19:43:46 +00:00 committed by Andreas Kling
parent f76c7f3788
commit bbc149ebb9
28 changed files with 65 additions and 54 deletions

View file

@ -327,13 +327,13 @@ public:
void set_font_size(float font_size) { m_inherited.font_size = font_size; }
void set_font_weight(int font_weight) { m_inherited.font_weight = font_weight; }
void set_font_variant(CSS::FontVariant font_variant) { m_inherited.font_variant = font_variant; }
void set_color(Color const& color) { m_inherited.color = color; }
void set_color(Color color) { m_inherited.color = color; }
void set_clip(CSS::Clip const& clip) { m_noninherited.clip = clip; }
void set_content(ContentData const& content) { m_noninherited.content = content; }
void set_cursor(CSS::Cursor cursor) { m_inherited.cursor = cursor; }
void set_image_rendering(CSS::ImageRendering value) { m_inherited.image_rendering = value; }
void set_pointer_events(CSS::PointerEvents value) { m_inherited.pointer_events = value; }
void set_background_color(Color const& color) { m_noninherited.background_color = color; }
void set_background_color(Color color) { m_noninherited.background_color = color; }
void set_background_layers(Vector<BackgroundLayerData>&& layers) { m_noninherited.background_layers = move(layers); }
void set_float(CSS::Float value) { m_noninherited.float_ = value; }
void set_clear(CSS::Clear value) { m_noninherited.clear = value; }

View file

@ -1642,13 +1642,13 @@ private:
class ShadowStyleValue final : public StyleValue {
public:
static NonnullRefPtr<ShadowStyleValue>
create(Color const& color, Length const& offset_x, Length const& offset_y, Length const& blur_radius, Length const& spread_distance, ShadowPlacement placement)
create(Color color, Length const& offset_x, Length const& offset_y, Length const& blur_radius, Length const& spread_distance, ShadowPlacement placement)
{
return adopt_ref(*new ShadowStyleValue(color, offset_x, offset_y, blur_radius, spread_distance, placement));
}
virtual ~ShadowStyleValue() override = default;
Color const& color() const { return m_color; }
Color color() const { return m_color; }
Length const& offset_x() const { return m_offset_x; }
Length const& offset_y() const { return m_offset_y; }
Length const& blur_radius() const { return m_blur_radius; }
@ -1659,7 +1659,7 @@ public:
virtual bool equals(StyleValue const& other) const override;
private:
explicit ShadowStyleValue(Color const& color, Length const& offset_x, Length const& offset_y, Length const& blur_radius, Length const& spread_distance, ShadowPlacement placement)
explicit ShadowStyleValue(Color color, Length const& offset_x, Length const& offset_y, Length const& blur_radius, Length const& spread_distance, ShadowPlacement placement)
: StyleValue(Type::Shadow)
, m_color(color)
, m_offset_x(offset_x)