coretext: address TODO

This commit is contained in:
Mitchell Hashimoto
2023-07-01 10:15:50 -07:00
parent 126817cac2
commit 06f63288c8

View File

@ -171,8 +171,10 @@ pub const Face = struct {
return error.InvalidAtlasFormat; return error.InvalidAtlasFormat;
} }
// Our buffer for rendering // Our buffer for rendering. We could cache this but glyph rasterization
// TODO(perf): cache this buffer // usually stabilizes pretty quickly and is very infrequent so I think
// the allocation overhead is acceptable compared to the cost of
// caching it forever or having to deal with a cache lifetime.
var buf = try alloc.alloc(u8, width * height * color.depth); var buf = try alloc.alloc(u8, width * height * color.depth);
defer alloc.free(buf); defer alloc.free(buf);
@memset(buf, 0); @memset(buf, 0);