diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-10 21:51:57 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-10 21:51:57 +0300 |
| commit | 425c86179791cd32e2d4ce0ae7f269940b4b0663 (patch) | |
| tree | e52c4383a6d69216cbe2a32638bf90841d7e2189 /vendor/libghostty-vt/src/font/glyf_rasterize.zig | |
| parent | 90e947a6e26e02f10ec7f1694c4eb5b78a86406b (diff) | |
chore: upgrade libghostty and preserve terminal behavior (#3906)
Diffstat (limited to 'vendor/libghostty-vt/src/font/glyf_rasterize.zig')
| -rw-r--r-- | vendor/libghostty-vt/src/font/glyf_rasterize.zig | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/vendor/libghostty-vt/src/font/glyf_rasterize.zig b/vendor/libghostty-vt/src/font/glyf_rasterize.zig index f321214b..f288ff0a 100644 --- a/vendor/libghostty-vt/src/font/glyf_rasterize.zig +++ b/vendor/libghostty-vt/src/font/glyf_rasterize.zig @@ -99,14 +99,16 @@ pub fn rasterize( // bitmap just like an empty outline. if (bounds.width() == 0 or bounds.height() == 0) return Bitmap.initEmpty(alloc, width, height); - // Build the surface we'll draw on. This is a simple alpha8 drawing. - var sfc: z2d.Surface = try .init( + // Build the surface directly over the bitmap we'll return. + const data = try alloc.alloc(u8, @as(usize, width) * @as(usize, height)); + errdefer alloc.free(data); + var sfc: z2d.Surface = .initBuffer( .image_surface_alpha8, - alloc, + null, + std.mem.bytesAsSlice(z2d.pixel.Alpha8, data), @intCast(width), @intCast(height), ); - defer sfc.deinit(alloc); var path: z2d.Path = .empty; defer path.deinit(alloc); @@ -133,7 +135,7 @@ pub fn rasterize( return .{ .width = width, .height = height, - .data = try alloc.dupe(u8, std.mem.sliceAsBytes(sfc.image_surface_alpha8.buf)), + .data = data, }; } |
