From 06f63288c8d7e74e09946d7f92a51b5ec271ba31 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sat, 1 Jul 2023 10:15:50 -0700 Subject: [PATCH] coretext: address TODO --- src/font/face/coretext.zig | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/font/face/coretext.zig b/src/font/face/coretext.zig index dc33cabcd..cdc4bd17d 100644 --- a/src/font/face/coretext.zig +++ b/src/font/face/coretext.zig @@ -171,8 +171,10 @@ pub const Face = struct { return error.InvalidAtlasFormat; } - // Our buffer for rendering - // TODO(perf): cache this buffer + // Our buffer for rendering. We could cache this but glyph rasterization + // 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); defer alloc.free(buf); @memset(buf, 0);