From cdf700ed847ef10ebe10d63bde057e0ec33cc0a0 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 27 Apr 2021 02:20:10 +0900 Subject: [PATCH] text: Improve the comments --- text/text.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/text/text.go b/text/text.go index 0bb4678be..1e9a43d6f 100644 --- a/text/text.go +++ b/text/text.go @@ -161,9 +161,9 @@ var textM sync.Mutex // // The two functions are implemented like this: // -// Draw = Create glyphs by `ReplacePixels` and put them into the cache if necessary -// + Draw them onto the destination by `DrawImage` -// CacheGlyphs = Create glyphs by `ReplacePixels` and put them into the cache if necessary +// Draw = Create glyphs by `(*ebiten.Image).ReplacePixels` and put them into the cache if necessary +// + Draw them onto the destination by `(*ebiten.Image).DrawImage` +// CacheGlyphs = Create glyphs by `(*ebiten.Image).ReplacePixels` and put them into the cache if necessary // // Be careful that the passed font face is held by this package and is never released. // This is a known issue (#498). @@ -283,15 +283,15 @@ func BoundString(face font.Face, text string) image.Rectangle { // Draw automatically creates and caches necessary glyphs, so usually you don't have to call CacheGlyphs // explicitly. However, for example, when you call Draw for each rune of one big text, Draw tries to create the glyph // cache and render it for each rune. This is very inefficient because creating a glyph image and rendering it are -// different operations (ReplacePixels and DrawImage) 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 regardless of the size of the text. +// different operations (`(*ebiten.Image).ReplacePixels` and `(*ebiten.Image).DrawImage`) 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 regardless of the size of the text. // // The two functions are implemented like this: // -// Draw = Create glyphs by `ReplacePixels` and put them into the cache if necessary -// + Draw them onto the destination by `DrawImage` -// CacheGlyphs = Create glyphs by `ReplacePixels` and put them into the cache if necessary +// Draw = Create glyphs by `(*ebiten.Image).ReplacePixels` and put them into the cache if necessary +// + Draw them onto the destination by `(*ebiten.Image).DrawImage` +// CacheGlyphs = Create glyphs by `(*ebiten.Image).ReplacePixels` and put them into the cache if necessary // // If a rune's glyph is already cached, CacheGlyphs does nothing for the rune. func CacheGlyphs(face font.Face, text string) {