mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 01:27:44 +00:00
Meta+Userland: Pass Gfx::IntPoint by value
This is just two ints or 8 bytes or the size of the reference on x86_64 or AArch64.
This commit is contained in:
parent
bbc149ebb9
commit
7be0b27dd3
161 changed files with 442 additions and 441 deletions
|
@ -355,7 +355,7 @@ void paint_all_borders(PaintContext& context, Gfx::FloatRect const& bordered_rec
|
|||
|
||||
// TODO: Support dual color corners. Other browsers will render a rounded corner between two borders of
|
||||
// different colors using both colours, normally split at a 45 degree angle (though the exact angle is interpolated).
|
||||
auto blit_corner = [&](Gfx::IntPoint const& position, Gfx::IntRect const& src_rect, Color corner_color) {
|
||||
auto blit_corner = [&](Gfx::IntPoint position, Gfx::IntRect const& src_rect, Color corner_color) {
|
||||
context.painter().blit_filtered(position, *corner_bitmap, src_rect, [&](auto const& corner_pixel) {
|
||||
return corner_color.with_alpha((corner_color.alpha() * corner_pixel.alpha()) / 255);
|
||||
});
|
||||
|
|
|
@ -35,7 +35,7 @@ Layout::FormAssociatedLabelableNode& LabelablePaintable::layout_box()
|
|||
return static_cast<Layout::FormAssociatedLabelableNode&>(PaintableBox::layout_box());
|
||||
}
|
||||
|
||||
LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned)
|
||||
LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned)
|
||||
{
|
||||
if (button != GUI::MouseButton::Primary || !layout_box().dom_node().enabled())
|
||||
return DispatchEventOfSameName::No;
|
||||
|
@ -46,7 +46,7 @@ LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousedown
|
|||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned button, unsigned)
|
||||
LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint position, unsigned button, unsigned)
|
||||
{
|
||||
if (!m_tracking_mouse || button != GUI::MouseButton::Primary || !layout_box().dom_node().enabled())
|
||||
return DispatchEventOfSameName::No;
|
||||
|
@ -61,7 +61,7 @@ LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mouseup(B
|
|||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned, unsigned)
|
||||
LabelablePaintable::DispatchEventOfSameName LabelablePaintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint position, unsigned, unsigned)
|
||||
{
|
||||
if (!m_tracking_mouse || !layout_box().dom_node().enabled())
|
||||
return DispatchEventOfSameName::No;
|
||||
|
|
|
@ -21,9 +21,9 @@ public:
|
|||
Layout::FormAssociatedLabelableNode& layout_box();
|
||||
|
||||
virtual bool wants_mouse_events() const override { return true; }
|
||||
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint, unsigned buttons, unsigned modifiers) override;
|
||||
|
||||
void handle_associated_label_mousedown(Badge<Layout::Label>);
|
||||
void handle_associated_label_mouseup(Badge<Layout::Label>);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace Web {
|
||||
|
||||
PaintContext::PaintContext(Gfx::Painter& painter, Palette const& palette, Gfx::IntPoint const& scroll_offset)
|
||||
PaintContext::PaintContext(Gfx::Painter& painter, Palette const& palette, Gfx::IntPoint scroll_offset)
|
||||
: m_painter(painter)
|
||||
, m_palette(palette)
|
||||
, m_scroll_offset(scroll_offset)
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace Web {
|
|||
|
||||
class PaintContext {
|
||||
public:
|
||||
PaintContext(Gfx::Painter& painter, Palette const& palette, Gfx::IntPoint const& scroll_offset);
|
||||
PaintContext(Gfx::Painter& painter, Palette const& palette, Gfx::IntPoint scroll_offset);
|
||||
|
||||
Gfx::Painter& painter() const { return m_painter; }
|
||||
Palette const& palette() const { return m_palette; }
|
||||
|
|
|
@ -10,22 +10,22 @@
|
|||
|
||||
namespace Web::Painting {
|
||||
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const&, unsigned, unsigned)
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint, unsigned, unsigned)
|
||||
{
|
||||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const&, unsigned, unsigned)
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint, unsigned, unsigned)
|
||||
{
|
||||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const&, unsigned, unsigned)
|
||||
Paintable::DispatchEventOfSameName Paintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint, unsigned, unsigned)
|
||||
{
|
||||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
bool Paintable::handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint const&, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y)
|
||||
bool Paintable::handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y)
|
||||
{
|
||||
if (auto* containing_block = this->containing_block()) {
|
||||
if (!containing_block->is_scrollable())
|
||||
|
|
|
@ -100,12 +100,12 @@ public:
|
|||
// When these methods return true, the DOM event with the same name will be
|
||||
// dispatch at the mouse_event_target if it returns a valid DOM::Node, or
|
||||
// the layout node's associated DOM node if it doesn't.
|
||||
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers);
|
||||
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers);
|
||||
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers);
|
||||
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers);
|
||||
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers);
|
||||
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint, unsigned buttons, unsigned modifiers);
|
||||
virtual DOM::Node* mouse_event_target() const { return nullptr; }
|
||||
|
||||
virtual bool handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
|
||||
virtual bool handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y);
|
||||
|
||||
Layout::Node const& layout_node() const { return m_layout_node; }
|
||||
Layout::Node& layout_node() { return const_cast<Layout::Node&>(m_layout_node); }
|
||||
|
|
|
@ -630,7 +630,7 @@ void PaintableWithLines::paint(PaintContext& context, PaintPhase phase) const
|
|||
}
|
||||
}
|
||||
|
||||
bool PaintableWithLines::handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint const&, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y)
|
||||
bool PaintableWithLines::handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint, unsigned, unsigned, int wheel_delta_x, int wheel_delta_y)
|
||||
{
|
||||
if (!layout_box().is_scrollable())
|
||||
return false;
|
||||
|
|
|
@ -188,7 +188,7 @@ public:
|
|||
|
||||
virtual void paint(PaintContext&, PaintPhase) const override;
|
||||
virtual bool wants_mouse_events() const override { return false; }
|
||||
virtual bool handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint const&, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y) override;
|
||||
virtual bool handle_mousewheel(Badge<EventHandler>, Gfx::IntPoint, unsigned buttons, unsigned modifiers, int wheel_delta_x, int wheel_delta_y) override;
|
||||
|
||||
virtual Optional<HitTestResult> hit_test(Gfx::FloatPoint const&, HitTestType) const override;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ DOM::Node* TextPaintable::mouse_event_target() const
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned button, unsigned)
|
||||
TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousedown(Badge<EventHandler>, Gfx::IntPoint position, unsigned button, unsigned)
|
||||
{
|
||||
auto* label = layout_node().first_ancestor_of_type<Layout::Label>();
|
||||
if (!label)
|
||||
|
@ -46,7 +46,7 @@ TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousedown(Badge<Eve
|
|||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
TextPaintable::DispatchEventOfSameName TextPaintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned button, unsigned)
|
||||
TextPaintable::DispatchEventOfSameName TextPaintable::handle_mouseup(Badge<EventHandler>, Gfx::IntPoint position, unsigned button, unsigned)
|
||||
{
|
||||
auto* label = layout_node().first_ancestor_of_type<Layout::Label>();
|
||||
if (!label)
|
||||
|
@ -57,7 +57,7 @@ TextPaintable::DispatchEventOfSameName TextPaintable::handle_mouseup(Badge<Event
|
|||
return DispatchEventOfSameName::Yes;
|
||||
}
|
||||
|
||||
TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const& position, unsigned button, unsigned)
|
||||
TextPaintable::DispatchEventOfSameName TextPaintable::handle_mousemove(Badge<EventHandler>, Gfx::IntPoint position, unsigned button, unsigned)
|
||||
{
|
||||
auto* label = layout_node().first_ancestor_of_type<Layout::Label>();
|
||||
if (!label)
|
||||
|
|
|
@ -18,9 +18,9 @@ public:
|
|||
|
||||
virtual bool wants_mouse_events() const override;
|
||||
virtual DOM::Node* mouse_event_target() const override;
|
||||
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint const&, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mousedown(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers) override;
|
||||
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, Gfx::IntPoint, unsigned button, unsigned modifiers) override;
|
||||
|
||||
private:
|
||||
explicit TextPaintable(Layout::TextNode const&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue