Move all debug flags in a single place.
This change also adds a new memory usage flag. When turned on, the
following is printed after every frame:
D/OpenGLRenderer( 3723): Current memory usage / total memory usage (bytes):
D/OpenGLRenderer( 3723): TextureCache 3766680 / 20971520
D/OpenGLRenderer( 3723): LayerCache 3538944 / 8388608
D/OpenGLRenderer( 3723): GradientCache 135168 / 524288
D/OpenGLRenderer( 3723): PathCache 41180 / 4194304
D/OpenGLRenderer( 3723): TextDropShadowCache 0 / 2097152
D/OpenGLRenderer( 3723): FontRenderer 0 262144 / 262144
D/OpenGLRenderer( 3723): FontRenderer 1 262144 / 262144
D/OpenGLRenderer( 3723): FontRenderer 2 262144 / 262144
D/OpenGLRenderer( 3723): Other:
D/OpenGLRenderer( 3723): FboCache 2 / 12
D/OpenGLRenderer( 3723): PatchCache 31 / 512
D/OpenGLRenderer( 3723): Total memory usage:
D/OpenGLRenderer( 3723): 8268404 bytes, 7.89 MB
This should help tracking possibe memory issues.
Change-Id: I83f483ca1d2dbef904829bce368e33fe5503e8d6
diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h
index a76cb86..7e749ca 100644
--- a/libs/hwui/FontRenderer.h
+++ b/libs/hwui/FontRenderer.h
@@ -169,6 +169,14 @@
return mTextureId;
}
+ uint32_t getCacheWidth() const {
+ return mCacheWidth;
+ }
+
+ uint32_t getCacheHeight() const {
+ return mCacheHeight;
+ }
+
protected:
friend class Font;
@@ -207,14 +215,6 @@
}
};
- uint32_t getCacheWidth() const {
- return mCacheWidth;
- }
-
- uint32_t getCacheHeight() const {
- return mCacheHeight;
- }
-
void initTextTexture();
bool cacheBitmap(const SkGlyph& glyph, uint32_t *retOriginX, uint32_t *retOriginY);