diff --git a/pkg/pixman/image.zig b/pkg/pixman/image.zig index e1e055be0..22c55c7ac 100644 --- a/pkg/pixman/image.zig +++ b/pkg/pixman/image.zig @@ -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, diff --git a/pkg/pixman/types.zig b/pkg/pixman/types.zig index 9b520896a..acebba68e 100644 --- a/pkg/pixman/types.zig +++ b/pkg/pixman/types.zig @@ -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,