WIP disabled glyph cache

This commit is contained in:
gerald1248 2016-12-11 01:58:46 +01:00
parent 1286d3b203
commit 5a77fece5e

View file

@ -10,6 +10,8 @@ func init() {
// FetchGlyph fetches a glyph from the cache, calling renderGlyph first if it doesn't already exist // FetchGlyph fetches a glyph from the cache, calling renderGlyph first if it doesn't already exist
func FetchGlyph(gc draw2d.GraphicContext, fontName string, chr rune) *Glyph { func FetchGlyph(gc draw2d.GraphicContext, fontName string, chr rune) *Glyph {
return renderGlyph(gc, fontName, chr)
/*
if glyphCache[fontName] == nil { if glyphCache[fontName] == nil {
glyphCache[fontName] = make(map[rune]*Glyph, 60) glyphCache[fontName] = make(map[rune]*Glyph, 60)
} }
@ -17,6 +19,7 @@ func FetchGlyph(gc draw2d.GraphicContext, fontName string, chr rune) *Glyph {
glyphCache[fontName][chr] = renderGlyph(gc, fontName, chr) glyphCache[fontName][chr] = renderGlyph(gc, fontName, chr)
} }
return glyphCache[fontName][chr].Copy() return glyphCache[fontName][chr].Copy()
*/
} }
// renderGlyph renders a glyph then caches and returns it // renderGlyph renders a glyph then caches and returns it