mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
pkg/pixman: fill rects
This commit is contained in:
@ -62,6 +62,21 @@ pub const Image = opaque {
|
||||
) == 0) return pixman.Error.PixmanFailure;
|
||||
}
|
||||
|
||||
pub fn fillRectangles(
|
||||
self: *Image,
|
||||
op: pixman.Op,
|
||||
color: pixman.Color,
|
||||
rects: []const pixman.Rectangle16,
|
||||
) pixman.Error!void {
|
||||
if (c.pixman_image_fill_rectangles(
|
||||
@enumToInt(op),
|
||||
@ptrCast(*c.pixman_image_t, self),
|
||||
@ptrCast(*const c.pixman_color_t, &color),
|
||||
@intCast(c_int, rects.len),
|
||||
@ptrCast([*c]const c.pixman_rectangle16_t, rects.ptr),
|
||||
) == 0) return pixman.Error.PixmanFailure;
|
||||
}
|
||||
|
||||
pub fn rasterizeTrapezoid(
|
||||
self: *Image,
|
||||
trap: pixman.Trapezoid,
|
||||
|
@ -100,6 +100,13 @@ pub const Trapezoid = extern struct {
|
||||
right: LineFixed,
|
||||
};
|
||||
|
||||
pub const Rectangle16 = extern struct {
|
||||
x: i16,
|
||||
y: i16,
|
||||
width: u16,
|
||||
height: u16,
|
||||
};
|
||||
|
||||
pub const Box32 = extern struct {
|
||||
x1: i32,
|
||||
y1: i32,
|
||||
|
Reference in New Issue
Block a user