summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-09-04 19:10:33 -0700
committerRomain Guy <romainguy@google.com>2012-09-04 19:20:06 -0700
commit521dc51fd411285f900c083a4fe560d2ed7c3f8a (patch)
treeb27e3be01ff583795fe9cead4ba6c46d71f80263 /libs
parent6c8c6d9d44f97ebfba9c6d997665ad58ac39273a (diff)
downloadframeworks_base-521dc51fd411285f900c083a4fe560d2ed7c3f8a.zip
frameworks_base-521dc51fd411285f900c083a4fe560d2ed7c3f8a.tar.gz
frameworks_base-521dc51fd411285f900c083a4fe560d2ed7c3f8a.tar.bz2
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
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/font/Font.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp
index 34e1a68..6e205b8 100644
--- a/libs/hwui/font/Font.cpp
+++ b/libs/hwui/font/Font.cpp
@@ -51,7 +51,7 @@ Font::~Font() {
void Font::invalidateTextureCache(CacheTexture* cacheTexture) {
for (uint32_t i = 0; i < mCachedGlyphs.size(); i++) {
CachedGlyphInfo* cachedGlyph = mCachedGlyphs.valueAt(i);
- if (cacheTexture || cachedGlyph->mCacheTexture == cacheTexture) {
+ if (!cacheTexture || cachedGlyph->mCacheTexture == cacheTexture) {
cachedGlyph->mIsValid = false;
}
}