mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 13:57:36 +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
|
@ -148,7 +148,7 @@ void AffineTransform::map(float unmapped_x, float unmapped_y, float& mapped_x, f
|
|||
}
|
||||
|
||||
template<>
|
||||
IntPoint AffineTransform::map(IntPoint const& point) const
|
||||
IntPoint AffineTransform::map(IntPoint point) const
|
||||
{
|
||||
float mapped_x;
|
||||
float mapped_y;
|
||||
|
@ -157,7 +157,7 @@ IntPoint AffineTransform::map(IntPoint const& point) const
|
|||
}
|
||||
|
||||
template<>
|
||||
FloatPoint AffineTransform::map(FloatPoint const& point) const
|
||||
FloatPoint AffineTransform::map(FloatPoint point) const
|
||||
{
|
||||
float mapped_x;
|
||||
float mapped_y;
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
void map(float unmapped_x, float unmapped_y, float& mapped_x, float& mapped_y) const;
|
||||
|
||||
template<Arithmetic T>
|
||||
Point<T> map(Point<T> const&) const;
|
||||
Point<T> map(Point<T>) const;
|
||||
|
||||
template<Arithmetic T>
|
||||
Size<T> map(Size<T> const&) const;
|
||||
|
|
|
@ -366,7 +366,7 @@ void AntiAliasingPainter::draw_ellipse(IntRect const& a_rect, Color color, int t
|
|||
m_underlying_painter.blit(a_rect.location(), outline_ellipse_bitmap, outline_ellipse_bitmap->rect(), color.alpha() / 255.);
|
||||
}
|
||||
|
||||
void AntiAliasingPainter::fill_circle(IntPoint const& center, int radius, Color color, BlendMode blend_mode)
|
||||
void AntiAliasingPainter::fill_circle(IntPoint center, int radius, Color color, BlendMode blend_mode)
|
||||
{
|
||||
if (radius <= 0)
|
||||
return;
|
||||
|
|
|
@ -51,7 +51,7 @@ public:
|
|||
|
||||
void fill_rect(FloatRect const&, Color);
|
||||
|
||||
void fill_circle(IntPoint const& center, int radius, Color, BlendMode blend_mode = BlendMode::Normal);
|
||||
void fill_circle(IntPoint center, int radius, Color, BlendMode blend_mode = BlendMode::Normal);
|
||||
void fill_ellipse(IntRect const& a_rect, Color, BlendMode blend_mode = BlendMode::Normal);
|
||||
|
||||
void fill_rect_with_rounded_corners(IntRect const&, Color, int radius);
|
||||
|
|
|
@ -636,7 +636,7 @@ Optional<Color> Bitmap::solid_color(u8 alpha_threshold) const
|
|||
return color;
|
||||
}
|
||||
|
||||
void Bitmap::flood_visit_from_point(Gfx::IntPoint const& start_point, int threshold,
|
||||
void Bitmap::flood_visit_from_point(Gfx::IntPoint start_point, int threshold,
|
||||
Function<void(Gfx::IntPoint location)> pixel_reached)
|
||||
{
|
||||
|
||||
|
|
|
@ -217,7 +217,7 @@ public:
|
|||
template<StorageFormat>
|
||||
[[nodiscard]] Color get_pixel(int physical_x, int physical_y) const;
|
||||
[[nodiscard]] Color get_pixel(int physical_x, int physical_y) const;
|
||||
[[nodiscard]] Color get_pixel(IntPoint const& physical_position) const
|
||||
[[nodiscard]] Color get_pixel(IntPoint physical_position) const
|
||||
{
|
||||
return get_pixel(physical_position.x(), physical_position.y());
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ public:
|
|||
template<StorageFormat>
|
||||
void set_pixel(int physical_x, int physical_y, Color);
|
||||
void set_pixel(int physical_x, int physical_y, Color);
|
||||
void set_pixel(IntPoint const& physical_position, Color color)
|
||||
void set_pixel(IntPoint physical_position, Color color)
|
||||
{
|
||||
set_pixel(physical_position.x(), physical_position.y(), color);
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ public:
|
|||
|
||||
[[nodiscard]] Optional<Color> solid_color(u8 alpha_threshold = 0) const;
|
||||
|
||||
void flood_visit_from_point(Gfx::IntPoint const& start_point, int threshold, Function<void(Gfx::IntPoint location)> pixel_reached);
|
||||
void flood_visit_from_point(Gfx::IntPoint start_point, int threshold, Function<void(Gfx::IntPoint location)> pixel_reached);
|
||||
|
||||
private:
|
||||
Bitmap(BitmapFormat, IntSize const&, int, BackingStore const&);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
namespace Gfx {
|
||||
|
||||
CursorParams CursorParams::parse_from_filename(StringView cursor_path, Gfx::IntPoint const& default_hotspot)
|
||||
CursorParams CursorParams::parse_from_filename(StringView cursor_path, Gfx::IntPoint default_hotspot)
|
||||
{
|
||||
LexicalPath path(cursor_path);
|
||||
auto file_title = path.title();
|
||||
|
|
|
@ -13,17 +13,17 @@ namespace Gfx {
|
|||
|
||||
class CursorParams {
|
||||
public:
|
||||
static CursorParams parse_from_filename(StringView, Gfx::IntPoint const&);
|
||||
static CursorParams parse_from_filename(StringView, Gfx::IntPoint);
|
||||
|
||||
CursorParams() = default;
|
||||
|
||||
CursorParams(Gfx::IntPoint const& hotspot)
|
||||
CursorParams(Gfx::IntPoint hotspot)
|
||||
: m_hotspot(hotspot)
|
||||
{
|
||||
}
|
||||
CursorParams constrained(Gfx::Bitmap const&) const;
|
||||
|
||||
Gfx::IntPoint const& hotspot() const { return m_hotspot; }
|
||||
Gfx::IntPoint hotspot() const { return m_hotspot; }
|
||||
unsigned frames() const { return m_frames; }
|
||||
unsigned frame_ms() const { return m_frame_ms; }
|
||||
|
||||
|
|
|
@ -429,7 +429,7 @@ void Painter::fill_rounded_corner(IntRect const& a_rect, int radius, Color color
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_circle_arc_intersecting(IntRect const& a_rect, IntPoint const& center, int radius, Color color, int thickness)
|
||||
void Painter::draw_circle_arc_intersecting(IntRect const& a_rect, IntPoint center, int radius, Color color, int thickness)
|
||||
{
|
||||
if (thickness <= 0 || radius <= 0)
|
||||
return;
|
||||
|
@ -651,7 +651,7 @@ void Painter::draw_rect_with_thickness(IntRect const& rect, Color color, int thi
|
|||
draw_line(p4, p1, color, thickness);
|
||||
}
|
||||
|
||||
void Painter::draw_bitmap(IntPoint const& p, CharacterBitmap const& bitmap, Color color)
|
||||
void Painter::draw_bitmap(IntPoint p, CharacterBitmap const& bitmap, Color color)
|
||||
{
|
||||
VERIFY(scale() == 1); // FIXME: Add scaling support.
|
||||
|
||||
|
@ -679,7 +679,7 @@ void Painter::draw_bitmap(IntPoint const& p, CharacterBitmap const& bitmap, Colo
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_bitmap(IntPoint const& p, GlyphBitmap const& bitmap, Color color)
|
||||
void Painter::draw_bitmap(IntPoint p, GlyphBitmap const& bitmap, Color color)
|
||||
{
|
||||
auto dst_rect = IntRect(p, bitmap.size()).translated(translation());
|
||||
auto clipped_rect = dst_rect.intersected(clip_rect());
|
||||
|
@ -718,13 +718,13 @@ void Painter::draw_bitmap(IntPoint const& p, GlyphBitmap const& bitmap, Color co
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_triangle(IntPoint const& offset, Span<IntPoint const> control_points, Color color)
|
||||
void Painter::draw_triangle(IntPoint offset, Span<IntPoint const> control_points, Color color)
|
||||
{
|
||||
VERIFY(control_points.size() == 3);
|
||||
draw_triangle(control_points[0] + offset, control_points[1] + offset, control_points[2] + offset, color);
|
||||
}
|
||||
|
||||
void Painter::draw_triangle(IntPoint const& a, IntPoint const& b, IntPoint const& c, Color color)
|
||||
void Painter::draw_triangle(IntPoint a, IntPoint b, IntPoint c, Color color)
|
||||
{
|
||||
IntPoint p0(to_physical(a));
|
||||
IntPoint p1(to_physical(b));
|
||||
|
@ -884,7 +884,7 @@ static void do_blit_with_opacity(BlitState& state)
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::blit_with_opacity(IntPoint const& position, Gfx::Bitmap const& source, IntRect const& a_src_rect, float opacity, bool apply_alpha)
|
||||
void Painter::blit_with_opacity(IntPoint position, Gfx::Bitmap const& source, IntRect const& a_src_rect, float opacity, bool apply_alpha)
|
||||
{
|
||||
VERIFY(scale() >= source.scale() && "painter doesn't support downsampling scale factors");
|
||||
|
||||
|
@ -934,7 +934,7 @@ void Painter::blit_with_opacity(IntPoint const& position, Gfx::Bitmap const& sou
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::blit_filtered(IntPoint const& position, Gfx::Bitmap const& source, IntRect const& src_rect, Function<Color(Color)> filter)
|
||||
void Painter::blit_filtered(IntPoint position, Gfx::Bitmap const& source, IntRect const& src_rect, Function<Color(Color)> filter)
|
||||
{
|
||||
VERIFY((source.scale() == 1 || source.scale() == scale()) && "blit_filtered only supports integer upsampling");
|
||||
|
||||
|
@ -999,14 +999,14 @@ void Painter::blit_filtered(IntPoint const& position, Gfx::Bitmap const& source,
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::blit_brightened(IntPoint const& position, Gfx::Bitmap const& source, IntRect const& src_rect)
|
||||
void Painter::blit_brightened(IntPoint position, Gfx::Bitmap const& source, IntRect const& src_rect)
|
||||
{
|
||||
return blit_filtered(position, source, src_rect, [](Color src) {
|
||||
return src.lightened();
|
||||
});
|
||||
}
|
||||
|
||||
void Painter::blit_dimmed(IntPoint const& position, Gfx::Bitmap const& source, IntRect const& src_rect)
|
||||
void Painter::blit_dimmed(IntPoint position, Gfx::Bitmap const& source, IntRect const& src_rect)
|
||||
{
|
||||
return blit_filtered(position, source, src_rect, [](Color src) {
|
||||
return src.to_grayscale().lightened();
|
||||
|
@ -1059,7 +1059,7 @@ void Painter::draw_tiled_bitmap(IntRect const& a_dst_rect, Gfx::Bitmap const& so
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
void Painter::blit_offset(IntPoint const& a_position, Gfx::Bitmap const& source, IntRect const& a_src_rect, IntPoint const& offset)
|
||||
void Painter::blit_offset(IntPoint a_position, Gfx::Bitmap const& source, IntRect const& a_src_rect, IntPoint offset)
|
||||
{
|
||||
auto src_rect = IntRect { a_src_rect.location() - offset, a_src_rect.size() };
|
||||
auto position = a_position;
|
||||
|
@ -1074,7 +1074,7 @@ void Painter::blit_offset(IntPoint const& a_position, Gfx::Bitmap const& source,
|
|||
blit(position, source, src_rect);
|
||||
}
|
||||
|
||||
void Painter::blit(IntPoint const& position, Gfx::Bitmap const& source, IntRect const& a_src_rect, float opacity, bool apply_alpha)
|
||||
void Painter::blit(IntPoint position, Gfx::Bitmap const& source, IntRect const& a_src_rect, float opacity, bool apply_alpha)
|
||||
{
|
||||
VERIFY(scale() >= source.scale() && "painter doesn't support downsampling scale factors");
|
||||
|
||||
|
@ -1356,12 +1356,12 @@ void Painter::draw_scaled_bitmap(IntRect const& a_dst_rect, Gfx::Bitmap const& s
|
|||
}
|
||||
}
|
||||
|
||||
FLATTEN void Painter::draw_glyph(IntPoint const& point, u32 code_point, Color color)
|
||||
FLATTEN void Painter::draw_glyph(IntPoint point, u32 code_point, Color color)
|
||||
{
|
||||
draw_glyph(point, code_point, font(), color);
|
||||
}
|
||||
|
||||
FLATTEN void Painter::draw_glyph(IntPoint const& point, u32 code_point, Font const& font, Color color)
|
||||
FLATTEN void Painter::draw_glyph(IntPoint point, u32 code_point, Font const& font, Color color)
|
||||
{
|
||||
auto glyph = font.glyph(code_point);
|
||||
auto top_left = point + IntPoint(glyph.left_bearing(), 0);
|
||||
|
@ -1375,7 +1375,7 @@ FLATTEN void Painter::draw_glyph(IntPoint const& point, u32 code_point, Font con
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_emoji(IntPoint const& point, Gfx::Bitmap const& emoji, Font const& font)
|
||||
void Painter::draw_emoji(IntPoint point, Gfx::Bitmap const& emoji, Font const& font)
|
||||
{
|
||||
IntRect dst_rect {
|
||||
point.x(),
|
||||
|
@ -1386,7 +1386,7 @@ void Painter::draw_emoji(IntPoint const& point, Gfx::Bitmap const& emoji, Font c
|
|||
draw_scaled_bitmap(dst_rect, emoji, emoji.rect());
|
||||
}
|
||||
|
||||
void Painter::draw_glyph_or_emoji(IntPoint const& point, u32 code_point, Font const& font, Color color)
|
||||
void Painter::draw_glyph_or_emoji(IntPoint point, u32 code_point, Font const& font, Color color)
|
||||
{
|
||||
StringBuilder builder;
|
||||
builder.append_code_point(code_point);
|
||||
|
@ -1394,7 +1394,7 @@ void Painter::draw_glyph_or_emoji(IntPoint const& point, u32 code_point, Font co
|
|||
return draw_glyph_or_emoji(point, it, font, color);
|
||||
}
|
||||
|
||||
void Painter::draw_glyph_or_emoji(IntPoint const& point, Utf8CodePointIterator& it, Font const& font, Color color)
|
||||
void Painter::draw_glyph_or_emoji(IntPoint point, Utf8CodePointIterator& it, Font const& font, Color color)
|
||||
{
|
||||
// FIXME: These should live somewhere else.
|
||||
constexpr u32 text_variation_selector = 0xFE0E;
|
||||
|
@ -1823,7 +1823,7 @@ void Painter::draw_text(Function<void(IntRect const&, Utf8CodePointIterator&)> d
|
|||
});
|
||||
}
|
||||
|
||||
void Painter::set_pixel(IntPoint const& p, Color color, bool blend)
|
||||
void Painter::set_pixel(IntPoint p, Color color, bool blend)
|
||||
{
|
||||
auto point = p;
|
||||
point.translate_by(state().translation);
|
||||
|
@ -1838,7 +1838,7 @@ void Painter::set_pixel(IntPoint const& p, Color color, bool blend)
|
|||
dst = Color::from_argb(dst).blend(color).value();
|
||||
}
|
||||
|
||||
Optional<Color> Painter::get_pixel(IntPoint const& p)
|
||||
Optional<Color> Painter::get_pixel(IntPoint p)
|
||||
{
|
||||
auto point = p;
|
||||
point.translate_by(state().translation);
|
||||
|
@ -1904,7 +1904,7 @@ ALWAYS_INLINE void Painter::fill_physical_scanline_with_draw_op(int y, int x, in
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_physical_pixel(IntPoint const& physical_position, Color color, int thickness)
|
||||
void Painter::draw_physical_pixel(IntPoint physical_position, Color color, int thickness)
|
||||
{
|
||||
// This always draws a single physical pixel, independent of scale().
|
||||
// This should only be called by routines that already handle scale
|
||||
|
@ -1924,7 +1924,7 @@ void Painter::draw_physical_pixel(IntPoint const& physical_position, Color color
|
|||
fill_physical_rect(rect, color);
|
||||
}
|
||||
|
||||
void Painter::draw_line(IntPoint const& a_p1, IntPoint const& a_p2, Color color, int thickness, LineStyle style, Color alternate_color)
|
||||
void Painter::draw_line(IntPoint a_p1, IntPoint a_p2, Color color, int thickness, LineStyle style, Color alternate_color)
|
||||
{
|
||||
if (thickness <= 0)
|
||||
return;
|
||||
|
@ -2061,7 +2061,7 @@ void Painter::draw_line(IntPoint const& a_p1, IntPoint const& a_p2, Color color,
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_triangle_wave(IntPoint const& a_p1, IntPoint const& a_p2, Color color, int amplitude, int thickness)
|
||||
void Painter::draw_triangle_wave(IntPoint a_p1, IntPoint a_p2, Color color, int amplitude, int thickness)
|
||||
{
|
||||
// FIXME: Support more than horizontal waves
|
||||
VERIFY(a_p1.y() == a_p2.y());
|
||||
|
@ -2137,7 +2137,7 @@ void Painter::for_each_line_segment_on_bezier_curve(FloatPoint const& control_po
|
|||
for_each_line_segment_on_bezier_curve(control_point, p1, p2, callback);
|
||||
}
|
||||
|
||||
void Painter::draw_quadratic_bezier_curve(IntPoint const& control_point, IntPoint const& p1, IntPoint const& p2, Color color, int thickness, LineStyle style)
|
||||
void Painter::draw_quadratic_bezier_curve(IntPoint control_point, IntPoint p1, IntPoint p2, Color color, int thickness, LineStyle style)
|
||||
{
|
||||
VERIFY(scale() == 1); // FIXME: Add scaling support.
|
||||
|
||||
|
@ -2212,7 +2212,7 @@ void Painter::for_each_line_segment_on_cubic_bezier_curve(FloatPoint const& cont
|
|||
}
|
||||
}
|
||||
|
||||
void Painter::draw_cubic_bezier_curve(IntPoint const& control_point_0, IntPoint const& control_point_1, IntPoint const& p1, IntPoint const& p2, Color color, int thickness, Painter::LineStyle style)
|
||||
void Painter::draw_cubic_bezier_curve(IntPoint control_point_0, IntPoint control_point_1, IntPoint p1, IntPoint p2, Color color, int thickness, Painter::LineStyle style)
|
||||
{
|
||||
for_each_line_segment_on_cubic_bezier_curve(FloatPoint(control_point_0), FloatPoint(control_point_1), FloatPoint(p1), FloatPoint(p2), [&](FloatPoint const& fp1, FloatPoint const& fp2) {
|
||||
draw_line(IntPoint(fp1.x(), fp1.y()), IntPoint(fp2.x(), fp2.y()), color, thickness, style);
|
||||
|
@ -2277,7 +2277,7 @@ void Painter::for_each_line_segment_on_elliptical_arc(FloatPoint const& p1, Floa
|
|||
for_each_line_segment_on_elliptical_arc(p1, p2, center, radii, x_axis_rotation, theta_1, theta_delta, callback);
|
||||
}
|
||||
|
||||
void Painter::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 color, int thickness, LineStyle style)
|
||||
void Painter::draw_elliptical_arc(IntPoint p1, IntPoint p2, IntPoint center, FloatPoint const& radii, float x_axis_rotation, float theta_1, float theta_delta, Color color, int thickness, LineStyle style)
|
||||
{
|
||||
VERIFY(scale() == 1); // FIXME: Add scaling support.
|
||||
|
||||
|
@ -2361,7 +2361,7 @@ void Painter::fill_path(Path const& path, Color color, WindingRule winding_rule)
|
|||
Detail::fill_path<Detail::FillPathMode::PlaceOnIntGrid>(*this, path, color, winding_rule);
|
||||
}
|
||||
|
||||
void Painter::blit_disabled(IntPoint const& location, Gfx::Bitmap const& bitmap, IntRect const& rect, Palette const& palette)
|
||||
void Painter::blit_disabled(IntPoint location, Gfx::Bitmap const& bitmap, IntRect const& rect, Palette const& palette)
|
||||
{
|
||||
auto bright_color = palette.threed_highlight();
|
||||
auto dark_color = palette.threed_shadow1();
|
||||
|
|
|
@ -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