summaryrefslogtreecommitdiff
path: root/libs/hwui/FontRenderer.cpp
diff options
context:
space:
mode:
author sergeyv <sergeyv@google.com> 2016-09-13 02:01:28 +0000
committer android-build-merger <android-build-merger@google.com> 2016-09-13 02:01:28 +0000
commit0ec2fd7bc5f3c57f7783425608732d2f95f53c4a (patch)
tree2877516239d17e2497c7bcceb12f1179f91819cc /libs/hwui/FontRenderer.cpp
parentee6aca55bd4d0e785823c672c557af5c477d5058 (diff)
parent42c01cf62fec651ca5f9dd4db9ac7c6c2e3fce8d (diff)
HWUI: track upload & recent usage in font cache am: af102bee51
am: 42c01cf62f Change-Id: Ieb80108d520aa629c54a40d7c533bf74a71849c4
Diffstat (limited to 'libs/hwui/FontRenderer.cpp')
-rw-r--r--libs/hwui/FontRenderer.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp
index 1cd708f3ce46..681cf55066b4 100644
--- a/libs/hwui/FontRenderer.cpp
+++ b/libs/hwui/FontRenderer.cpp
@@ -168,10 +168,17 @@ void FontRenderer::flushAllAndInvalidate() {
for (uint32_t i = 0; i < mACacheTextures.size(); i++) {
mACacheTextures[i]->init();
+
+#ifdef BUGREPORT_FONT_CACHE_USAGE
+ mHistoryTracker.glyphsCleared(mACacheTextures[i]);
+#endif
}
for (uint32_t i = 0; i < mRGBACacheTextures.size(); i++) {
mRGBACacheTextures[i]->init();
+#ifdef BUGREPORT_FONT_CACHE_USAGE
+ mHistoryTracker.glyphsCleared(mRGBACacheTextures[i]);
+#endif
}
mDrawn = false;
@@ -183,6 +190,9 @@ void FontRenderer::flushLargeCaches(std::vector<CacheTexture*>& cacheTextures) {
CacheTexture* cacheTexture = cacheTextures[i];
if (cacheTexture->getPixelBuffer()) {
cacheTexture->init();
+#ifdef BUGREPORT_FONT_CACHE_USAGE
+ mHistoryTracker.glyphsCleared(cacheTexture);
+#endif
LruCache<Font::FontDescription, Font*>::Iterator it(mActiveFonts);
while (it.next()) {
it.value()->invalidateTextureCache(cacheTexture);
@@ -385,6 +395,10 @@ void FontRenderer::cacheBitmap(const SkGlyph& glyph, CachedGlyphInfo* cachedGlyp
}
cachedGlyph->mIsValid = true;
+
+#ifdef BUGREPORT_FONT_CACHE_USAGE
+ mHistoryTracker.glyphUploaded(cacheTexture, startX, startY, glyph.fWidth, glyph.fHeight);
+#endif
}
CacheTexture* FontRenderer::createCacheTexture(int width, int height, GLenum format,