Loading libs/hwui/Caches.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <utils/Log.h> #include "Caches.h" #include "Properties.h" namespace android { Loading Loading @@ -49,6 +50,9 @@ Caches::Caches(): Singleton<Caches>(), blend(false), lastSrcMode(GL_ZERO), mCurrentBuffer = meshBuffer; mRegionMesh = NULL; mDebugLevel = readDebugLevel(); LOGD("Enabling debug mode %d", mDebugLevel); } Caches::~Caches() { Loading libs/hwui/Caches.h +12 −1 Original line number Diff line number Diff line Loading @@ -83,7 +83,7 @@ class Caches: public Singleton<Caches> { friend class Singleton<Caches>; CacheLogger mlogger; CacheLogger mLogger; GLuint mCurrentBuffer; Loading @@ -92,6 +92,14 @@ class Caches: public Singleton<Caches> { GLuint mRegionMeshIndices; public: /** * Indicates whether the renderer is in debug mode. * This debug mode provides limited information to app developers. */ DebugLevel getDebugLevel() const { return mDebugLevel; } /** * Binds the VBO used to render simple textured quads. */ Loading Loading @@ -145,6 +153,9 @@ public: ResourceCache resourceCache; Line line; private: DebugLevel mDebugLevel; }; // class Caches }; // namespace uirenderer Loading libs/hwui/OpenGLRenderer.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -163,6 +163,10 @@ void OpenGLRenderer::finish() { #endif #if DEBUG_MEMORY_USAGE mCaches.dumpMemoryUsage(); #else if (mCaches.getDebugLevel() & kDebugMemory) { mCaches.dumpMemoryUsage(); } #endif } Loading libs/hwui/PathCache.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,8 @@ void PathCache::init() { GLint maxTextureSize; glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize); mMaxTextureSize = maxTextureSize; mDebugEnabled = readDebugLevel() & kDebugCaches; } /////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -98,6 +100,9 @@ void PathCache::operator()(PathCacheEntry& path, PathTexture*& texture) { PATH_LOGD("PathCache::callback: delete path: name, size, mSize = %d, %d, %d", texture->id, size, mSize); if (mDebugEnabled) { LOGD("Path deleted, size = %d", size); } glDeleteTextures(1, &texture->id); delete texture; Loading Loading @@ -199,6 +204,9 @@ PathTexture* PathCache::addTexture(const PathCacheEntry& entry, mSize += size; PATH_LOGD("PathCache::get: create path: name, size, mSize = %d, %d, %d", texture->id, size, mSize); if (mDebugEnabled) { LOGD("Path created, size = %d", size); } mCache.put(entry, texture); mLock.unlock(); } else { Loading libs/hwui/PathCache.h +2 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,8 @@ private: uint32_t mMaxSize; GLuint mMaxTextureSize; bool mDebugEnabled; /** * Used to access mCache and mSize. All methods are accessed from a single * thread except for remove(). Loading Loading
libs/hwui/Caches.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <utils/Log.h> #include "Caches.h" #include "Properties.h" namespace android { Loading Loading @@ -49,6 +50,9 @@ Caches::Caches(): Singleton<Caches>(), blend(false), lastSrcMode(GL_ZERO), mCurrentBuffer = meshBuffer; mRegionMesh = NULL; mDebugLevel = readDebugLevel(); LOGD("Enabling debug mode %d", mDebugLevel); } Caches::~Caches() { Loading
libs/hwui/Caches.h +12 −1 Original line number Diff line number Diff line Loading @@ -83,7 +83,7 @@ class Caches: public Singleton<Caches> { friend class Singleton<Caches>; CacheLogger mlogger; CacheLogger mLogger; GLuint mCurrentBuffer; Loading @@ -92,6 +92,14 @@ class Caches: public Singleton<Caches> { GLuint mRegionMeshIndices; public: /** * Indicates whether the renderer is in debug mode. * This debug mode provides limited information to app developers. */ DebugLevel getDebugLevel() const { return mDebugLevel; } /** * Binds the VBO used to render simple textured quads. */ Loading Loading @@ -145,6 +153,9 @@ public: ResourceCache resourceCache; Line line; private: DebugLevel mDebugLevel; }; // class Caches }; // namespace uirenderer Loading
libs/hwui/OpenGLRenderer.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -163,6 +163,10 @@ void OpenGLRenderer::finish() { #endif #if DEBUG_MEMORY_USAGE mCaches.dumpMemoryUsage(); #else if (mCaches.getDebugLevel() & kDebugMemory) { mCaches.dumpMemoryUsage(); } #endif } Loading
libs/hwui/PathCache.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -63,6 +63,8 @@ void PathCache::init() { GLint maxTextureSize; glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize); mMaxTextureSize = maxTextureSize; mDebugEnabled = readDebugLevel() & kDebugCaches; } /////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -98,6 +100,9 @@ void PathCache::operator()(PathCacheEntry& path, PathTexture*& texture) { PATH_LOGD("PathCache::callback: delete path: name, size, mSize = %d, %d, %d", texture->id, size, mSize); if (mDebugEnabled) { LOGD("Path deleted, size = %d", size); } glDeleteTextures(1, &texture->id); delete texture; Loading Loading @@ -199,6 +204,9 @@ PathTexture* PathCache::addTexture(const PathCacheEntry& entry, mSize += size; PATH_LOGD("PathCache::get: create path: name, size, mSize = %d, %d, %d", texture->id, size, mSize); if (mDebugEnabled) { LOGD("Path created, size = %d", size); } mCache.put(entry, texture); mLock.unlock(); } else { Loading
libs/hwui/PathCache.h +2 −0 Original line number Diff line number Diff line Loading @@ -176,6 +176,8 @@ private: uint32_t mMaxSize; GLuint mMaxTextureSize; bool mDebugEnabled; /** * Used to access mCache and mSize. All methods are accessed from a single * thread except for remove(). Loading