From cd779b678ac5848e906ed2fa59d88e5c7216dba1 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 3 Nov 2020 20:35:55 +0900 Subject: [PATCH] text: Add comments --- text/text.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/text/text.go b/text/text.go index 4691d7377..95c06b5f3 100644 --- a/text/text.go +++ b/text/text.go @@ -291,6 +291,8 @@ func BoundString(face font.Face, text string) image.Rectangle { // cache and render it for each rune. This is very inefficient because creating a glyph image and rendering it are // different operations and can never be merged as one draw call. CacheGlyphs creates necessary glyphs without // rendering them so that these operations are likely merged into one draw call. +// +// If a rune's glyph is already cached, CacheGlyphs does nothing for the rune. func CacheGlyphs(face font.Face, text string) { textM.Lock() defer textM.Unlock()