summaryrefslogtreecommitdiff
path: root/libs/hwui/TextureCache.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2010-11-10 19:06:17 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2010-11-10 19:06:17 -0800
commit6ae689201f23643bcffc8ca95872a905ff2f8d32 (patch)
tree9b6b5dbc191e2feba2d125e0c0b5bd7d80064107 /libs/hwui/TextureCache.cpp
parent2f8b27bfe5527e9b6b5078123d38fb5e65fff5ec (diff)
parente190aa69756aecfaffabdd4c6d32cb6b3220d842 (diff)
Merge "Add new runtime debug flags."
Diffstat (limited to 'libs/hwui/TextureCache.cpp')
-rw-r--r--libs/hwui/TextureCache.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp
index 2497925d66e1..1be6868cc051 100644
--- a/libs/hwui/TextureCache.cpp
+++ b/libs/hwui/TextureCache.cpp
@@ -62,6 +62,8 @@ void TextureCache::init() {
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize);
LOGD(" Maximum texture dimension is %d pixels", mMaxTextureSize);
+
+ mDebugEnabled = readDebugLevel() & kDebugCaches;
}
///////////////////////////////////////////////////////////////////////////////
@@ -96,6 +98,9 @@ void TextureCache::operator()(SkBitmap*& bitmap, Texture*& texture) {
mSize -= texture->bitmapSize;
TEXTURE_LOGD("TextureCache::callback: name, removed size, mSize = %d, %d, %d",
texture->id, texture->bitmapSize, mSize);
+ if (mDebugEnabled) {
+ LOGD("Texture deleted, size = %d", texture->bitmapSize);
+ }
glDeleteTextures(1, &texture->id);
delete texture;
}
@@ -135,6 +140,9 @@ Texture* TextureCache::get(SkBitmap* bitmap) {
mSize += size;
TEXTURE_LOGD("TextureCache::get: create texture(%p): name, size, mSize = %d, %d, %d",
bitmap, texture->id, size, mSize);
+ if (mDebugEnabled) {
+ LOGD("Texture created, size = %d", size);
+ }
mCache.put(bitmap, texture);
mLock.unlock();
} else {