mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 15:47:45 +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
|
@ -55,30 +55,30 @@ public:
|
|||
void draw_rect(IntRect const&, Color, bool rough = false);
|
||||
void draw_rect_with_thickness(IntRect const&, Color, int thickness);
|
||||
void draw_focus_rect(IntRect const&, Color);
|
||||
void draw_bitmap(IntPoint const&, CharacterBitmap const&, Color = Color());
|
||||
void draw_bitmap(IntPoint const&, GlyphBitmap const&, Color = Color());
|
||||
void draw_bitmap(IntPoint, CharacterBitmap const&, Color = Color());
|
||||
void draw_bitmap(IntPoint, GlyphBitmap const&, Color = Color());
|
||||
void draw_scaled_bitmap(IntRect const& dst_rect, Gfx::Bitmap const&, IntRect const& src_rect, float opacity = 1.0f, ScalingMode = ScalingMode::NearestNeighbor);
|
||||
void draw_scaled_bitmap(IntRect const& dst_rect, Gfx::Bitmap const&, FloatRect const& src_rect, float opacity = 1.0f, ScalingMode = ScalingMode::NearestNeighbor);
|
||||
void draw_scaled_bitmap_with_transform(IntRect const& dst_rect, Gfx::Bitmap const&, FloatRect const& src_rect, Gfx::AffineTransform const&, float opacity = 1.0f, ScalingMode = ScalingMode::NearestNeighbor);
|
||||
void draw_triangle(IntPoint const&, IntPoint const&, IntPoint const&, Color);
|
||||
void draw_triangle(IntPoint const& offset, Span<IntPoint const>, Color);
|
||||
void draw_triangle(IntPoint, IntPoint, IntPoint, Color);
|
||||
void draw_triangle(IntPoint offset, Span<IntPoint const>, Color);
|
||||
void draw_ellipse_intersecting(IntRect const&, Color, int thickness = 1);
|
||||
void set_pixel(IntPoint const&, Color, bool blend = false);
|
||||
void set_pixel(IntPoint, Color, bool blend = false);
|
||||
void set_pixel(int x, int y, Color color, bool blend = false) { set_pixel({ x, y }, color, blend); }
|
||||
Optional<Color> get_pixel(IntPoint const&);
|
||||
Optional<Color> get_pixel(IntPoint);
|
||||
ErrorOr<NonnullRefPtr<Bitmap>> get_region_bitmap(IntRect const&, BitmapFormat format, Optional<IntRect&> actual_region = {});
|
||||
void draw_line(IntPoint const&, IntPoint const&, Color, int thickness = 1, LineStyle style = LineStyle::Solid, Color alternate_color = Color::Transparent);
|
||||
void draw_triangle_wave(IntPoint const&, IntPoint const&, Color color, int amplitude, int thickness = 1);
|
||||
void draw_quadratic_bezier_curve(IntPoint const& control_point, IntPoint const&, IntPoint const&, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
|
||||
void draw_cubic_bezier_curve(IntPoint const& control_point_0, IntPoint const& control_point_1, IntPoint const&, IntPoint const&, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
|
||||
void draw_elliptical_arc(IntPoint const& p1, IntPoint const& p2, IntPoint const& center, FloatPoint const& radii, float x_axis_rotation, float theta_1, float theta_delta, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
|
||||
void blit(IntPoint const&, Gfx::Bitmap const&, IntRect const& src_rect, float opacity = 1.0f, bool apply_alpha = true);
|
||||
void blit_dimmed(IntPoint const&, Gfx::Bitmap const&, IntRect const& src_rect);
|
||||
void blit_brightened(IntPoint const&, Gfx::Bitmap const&, IntRect const& src_rect);
|
||||
void blit_filtered(IntPoint const&, Gfx::Bitmap const&, IntRect const& src_rect, Function<Color(Color)>);
|
||||
void draw_line(IntPoint, IntPoint, Color, int thickness = 1, LineStyle style = LineStyle::Solid, Color alternate_color = Color::Transparent);
|
||||
void draw_triangle_wave(IntPoint, IntPoint, Color color, int amplitude, int thickness = 1);
|
||||
void draw_quadratic_bezier_curve(IntPoint control_point, IntPoint, IntPoint, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
|
||||
void draw_cubic_bezier_curve(IntPoint control_point_0, IntPoint control_point_1, IntPoint, IntPoint, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
|
||||
void draw_elliptical_arc(IntPoint p1, IntPoint p2, IntPoint center, FloatPoint const& radii, float x_axis_rotation, float theta_1, float theta_delta, Color, int thickness = 1, LineStyle style = LineStyle::Solid);
|
||||
void blit(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect, float opacity = 1.0f, bool apply_alpha = true);
|
||||
void blit_dimmed(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect);
|
||||
void blit_brightened(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect);
|
||||
void blit_filtered(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect, Function<Color(Color)>);
|
||||
void draw_tiled_bitmap(IntRect const& dst_rect, Gfx::Bitmap const&);
|
||||
void blit_offset(IntPoint const&, Gfx::Bitmap const&, IntRect const& src_rect, IntPoint const&);
|
||||
void blit_disabled(IntPoint const&, Gfx::Bitmap const&, IntRect const&, Palette const&);
|
||||
void blit_offset(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect, IntPoint);
|
||||
void blit_disabled(IntPoint, Gfx::Bitmap const&, IntRect const&, Palette const&);
|
||||
void blit_tiled(IntRect const&, Gfx::Bitmap const&, IntRect const& src_rect);
|
||||
void draw_text(IntRect const&, StringView, Font const&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_text(IntRect const&, StringView, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
|
@ -88,12 +88,12 @@ public:
|
|||
void draw_text(Function<void(IntRect const&, Utf8CodePointIterator&)>, IntRect const&, Utf8View const&, Font const&, TextAlignment = TextAlignment::TopLeft, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_text(Function<void(IntRect const&, Utf8CodePointIterator&)>, IntRect const&, Utf32View const&, Font const&, TextAlignment = TextAlignment::TopLeft, TextElision = TextElision::None, TextWrapping = TextWrapping::DontWrap);
|
||||
void draw_ui_text(Gfx::IntRect const&, StringView, Gfx::Font const&, TextAlignment, Gfx::Color);
|
||||
void draw_glyph(IntPoint const&, u32, Color);
|
||||
void draw_glyph(IntPoint const&, u32, Font const&, Color);
|
||||
void draw_emoji(IntPoint const&, Gfx::Bitmap const&, Font const&);
|
||||
void draw_glyph_or_emoji(IntPoint const&, u32, Font const&, Color);
|
||||
void draw_glyph_or_emoji(IntPoint const&, Utf8CodePointIterator&, Font const&, Color);
|
||||
void draw_circle_arc_intersecting(IntRect const&, IntPoint const&, int radius, Color, int thickness);
|
||||
void draw_glyph(IntPoint, u32, Color);
|
||||
void draw_glyph(IntPoint, u32, Font const&, Color);
|
||||
void draw_emoji(IntPoint, Gfx::Bitmap const&, Font const&);
|
||||
void draw_glyph_or_emoji(IntPoint, u32, Font const&, Color);
|
||||
void draw_glyph_or_emoji(IntPoint, Utf8CodePointIterator&, Font const&, Color);
|
||||
void draw_circle_arc_intersecting(IntRect const&, IntPoint, int radius, Color, int thickness);
|
||||
|
||||
// Streamlined text drawing routine that does no wrapping/elision/alignment.
|
||||
void draw_text_run(FloatPoint const& baseline_start, Utf8View const&, Font const&, Color);
|
||||
|
@ -143,7 +143,7 @@ public:
|
|||
void clear_clip_rect();
|
||||
|
||||
void translate(int dx, int dy) { translate({ dx, dy }); }
|
||||
void translate(IntPoint const& delta) { state().translation.translate_by(delta); }
|
||||
void translate(IntPoint delta) { state().translation.translate_by(delta); }
|
||||
|
||||
IntPoint translation() const { return state().translation; }
|
||||
|
||||
|
@ -162,12 +162,12 @@ public:
|
|||
|
||||
protected:
|
||||
IntRect to_physical(IntRect const& r) const { return r.translated(translation()) * scale(); }
|
||||
IntPoint to_physical(IntPoint const& p) const { return p.translated(translation()) * scale(); }
|
||||
IntPoint to_physical(IntPoint p) const { return p.translated(translation()) * scale(); }
|
||||
void set_physical_pixel_with_draw_op(u32& pixel, Color);
|
||||
void fill_physical_scanline_with_draw_op(int y, int x, int width, Color color);
|
||||
void fill_rect_with_draw_op(IntRect const&, Color);
|
||||
void blit_with_opacity(IntPoint const&, Gfx::Bitmap const&, IntRect const& src_rect, float opacity, bool apply_alpha = true);
|
||||
void draw_physical_pixel(IntPoint const&, Color, int thickness = 1);
|
||||
void blit_with_opacity(IntPoint, Gfx::Bitmap const&, IntRect const& src_rect, float opacity, bool apply_alpha = true);
|
||||
void draw_physical_pixel(IntPoint, Color, int thickness = 1);
|
||||
|
||||
struct State {
|
||||
Font const* font;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue