Don't invalidate all the glyphs when flushing large textures
FontRenderer::flushLargeCaches identifies the large textures used to cache glyphs and visits all the known fonts to mark their glyphs invalid if they belong to one of these large textures. Unfortunately, Font::invalidateTextureCache had a logic error which would make it mark *all glyphs* as invalid, not matter what texture they belong to. This means that any large cache flush would cause all glyphs to be invalidate, thus forcing the rendering system to recreate them on the next draw. Font::invalidateTextureCache is supposed to behave this way: - If the specified cacheTexture is NULL (default value), mark all glyphs as invalid (see FontRenderer::flushAllAndInvalidate()) - If cacheTexture is *not* NULL, invalidate only the glyphs for which glyph.cacheTexture == cacheTexture. The previous condition read: if (cacheTexture || glyph.cacheTexture == cacheTexture) This test *always* passes. Change-Id: I418886cb594c81c6178d0f9e9953d975e991cf22
Loading
Please register or sign in to comment