diff options
author | Romain Guy <romainguy@google.com> | 2011-01-21 21:18:06 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-01-21 21:18:06 -0800 |
commit | a8fe99235184c3902954f3f21e153f27802b0f90 (patch) | |
tree | 7b43c90de51fe48e7435aef3895b3422d6304d49 | |
parent | 2e6927c40e672a76cfaace2cd6dd7260eb52a390 (diff) | |
parent | acf36126e4620a0cc36d4e5b1268d15777ea4361 (diff) | |
download | frameworks_base-a8fe99235184c3902954f3f21e153f27802b0f90.zip frameworks_base-a8fe99235184c3902954f3f21e153f27802b0f90.tar.gz frameworks_base-a8fe99235184c3902954f3f21e153f27802b0f90.tar.bz2 |
am acf36126: Merge "Log only 1 line per process when using OpenGLRenderer." into honeycomb
* commit 'acf36126e4620a0cc36d4e5b1268d15777ea4361':
Log only 1 line per process when using OpenGLRenderer.
-rw-r--r-- | libs/hwui/Caches.h | 2 | ||||
-rw-r--r-- | libs/hwui/Debug.h | 9 | ||||
-rw-r--r-- | libs/hwui/FboCache.cpp | 5 | ||||
-rw-r--r-- | libs/hwui/FontRenderer.cpp | 17 | ||||
-rw-r--r-- | libs/hwui/GammaFontRenderer.cpp | 15 | ||||
-rw-r--r-- | libs/hwui/GradientCache.cpp | 5 | ||||
-rw-r--r-- | libs/hwui/LayerCache.cpp | 5 | ||||
-rw-r--r-- | libs/hwui/ShapeCache.h | 4 | ||||
-rw-r--r-- | libs/hwui/TextDropShadowCache.cpp | 6 | ||||
-rw-r--r-- | libs/hwui/TextureCache.cpp | 4 |
10 files changed, 47 insertions, 25 deletions
diff --git a/libs/hwui/Caches.h b/libs/hwui/Caches.h index aa0ceb7..24585d5 100644 --- a/libs/hwui/Caches.h +++ b/libs/hwui/Caches.h @@ -69,7 +69,7 @@ static const GLsizei gMeshCount = 4; struct CacheLogger { CacheLogger() { - LOGD("Creating caches"); + LOGD("Creating OpenGL renderer caches"); } }; // struct CacheLogger diff --git a/libs/hwui/Debug.h b/libs/hwui/Debug.h index 6236684..14471bc 100644 --- a/libs/hwui/Debug.h +++ b/libs/hwui/Debug.h @@ -20,6 +20,9 @@ // Turn on to check for OpenGL errors on each frame #define DEBUG_OPENGL 1 +// Turn on to enable initialization information +#define DEBUG_INIT 0 + // Turn on to enable memory usage summary on each frame #define DEBUG_MEMORY_USAGE 0 @@ -54,4 +57,10 @@ // Turn on to dump display list state #define DEBUG_DISPLAY_LIST 0 +#if DEBUG_INIT + #define INIT_LOGD(...) LOGD(__VA_ARGS__) +#else + #define INIT_LOGD(...) +#endif + #endif // ANDROID_HWUI_DEBUG_H diff --git a/libs/hwui/FboCache.cpp b/libs/hwui/FboCache.cpp index 2ef71c2..beef7be 100644 --- a/libs/hwui/FboCache.cpp +++ b/libs/hwui/FboCache.cpp @@ -18,6 +18,7 @@ #include <stdlib.h> +#include "Debug.h" #include "FboCache.h" #include "Properties.h" @@ -31,10 +32,10 @@ namespace uirenderer { FboCache::FboCache(): mMaxSize(DEFAULT_FBO_CACHE_SIZE) { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_FBO_CACHE_SIZE, property, NULL) > 0) { - LOGD(" Setting fbo cache size to %s", property); + INIT_LOGD(" Setting fbo cache size to %s", property); mMaxSize = atoi(property); } else { - LOGD(" Using default fbo cache size of %d", DEFAULT_FBO_CACHE_SIZE); + INIT_LOGD(" Using default fbo cache size of %d", DEFAULT_FBO_CACHE_SIZE); } } diff --git a/libs/hwui/FontRenderer.cpp b/libs/hwui/FontRenderer.cpp index c43e40d..0042f49 100644 --- a/libs/hwui/FontRenderer.cpp +++ b/libs/hwui/FontRenderer.cpp @@ -22,6 +22,7 @@ #include <utils/Log.h> +#include "Debug.h" #include "FontRenderer.h" namespace android { @@ -301,7 +302,9 @@ Font* Font::create(FontRenderer* state, uint32_t fontId, float fontSize, static bool sLogFontRendererCreate = true; FontRenderer::FontRenderer() { - if (sLogFontRendererCreate) LOGD("Creating FontRenderer"); + if (sLogFontRendererCreate) { + INIT_LOGD("Creating FontRenderer"); + } mGammaTable = NULL; mInitialized = false; @@ -319,20 +322,24 @@ FontRenderer::FontRenderer() { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_TEXT_CACHE_WIDTH, property, NULL) > 0) { - if (sLogFontRendererCreate) LOGD(" Setting text cache width to %s pixels", property); + if (sLogFontRendererCreate) { + INIT_LOGD(" Setting text cache width to %s pixels", property); + } mCacheWidth = atoi(property); } else { if (sLogFontRendererCreate) { - LOGD(" Using default text cache width of %i pixels", mCacheWidth); + INIT_LOGD(" Using default text cache width of %i pixels", mCacheWidth); } } if (property_get(PROPERTY_TEXT_CACHE_HEIGHT, property, NULL) > 0) { - if (sLogFontRendererCreate) LOGD(" Setting text cache width to %s pixels", property); + if (sLogFontRendererCreate) { + INIT_LOGD(" Setting text cache width to %s pixels", property); + } mCacheHeight = atoi(property); } else { if (sLogFontRendererCreate) { - LOGD(" Using default text cache height of %i pixels", mCacheHeight); + INIT_LOGD(" Using default text cache height of %i pixels", mCacheHeight); } } diff --git a/libs/hwui/GammaFontRenderer.cpp b/libs/hwui/GammaFontRenderer.cpp index 6d087e3..e8362dc 100644 --- a/libs/hwui/GammaFontRenderer.cpp +++ b/libs/hwui/GammaFontRenderer.cpp @@ -16,6 +16,7 @@ #define LOG_TAG "OpenGLRenderer" +#include "Debug.h" #include "GammaFontRenderer.h" #include "Properties.h" @@ -27,7 +28,7 @@ namespace uirenderer { /////////////////////////////////////////////////////////////////////////////// GammaFontRenderer::GammaFontRenderer() { - LOGD("Creating gamma font renderer"); + INIT_LOGD("Creating gamma font renderer"); // Get the renderer properties char property[PROPERTY_VALUE_MAX]; @@ -35,29 +36,29 @@ GammaFontRenderer::GammaFontRenderer() { // Get the gamma float gamma = DEFAULT_TEXT_GAMMA; if (property_get(PROPERTY_TEXT_GAMMA, property, NULL) > 0) { - LOGD(" Setting text gamma to %s", property); + INIT_LOGD(" Setting text gamma to %s", property); gamma = atof(property); } else { - LOGD(" Using default text gamma of %.2f", DEFAULT_TEXT_GAMMA); + INIT_LOGD(" Using default text gamma of %.2f", DEFAULT_TEXT_GAMMA); } // Get the black gamma threshold mBlackThreshold = DEFAULT_TEXT_BLACK_GAMMA_THRESHOLD; if (property_get(PROPERTY_TEXT_BLACK_GAMMA_THRESHOLD, property, NULL) > 0) { - LOGD(" Setting text black gamma threshold to %s", property); + INIT_LOGD(" Setting text black gamma threshold to %s", property); mBlackThreshold = atoi(property); } else { - LOGD(" Using default text black gamma threshold of %d", + INIT_LOGD(" Using default text black gamma threshold of %d", DEFAULT_TEXT_BLACK_GAMMA_THRESHOLD); } // Get the white gamma threshold mWhiteThreshold = DEFAULT_TEXT_WHITE_GAMMA_THRESHOLD; if (property_get(PROPERTY_TEXT_WHITE_GAMMA_THRESHOLD, property, NULL) > 0) { - LOGD(" Setting text white gamma threshold to %s", property); + INIT_LOGD(" Setting text white gamma threshold to %s", property); mWhiteThreshold = atoi(property); } else { - LOGD(" Using default white black gamma threshold of %d", + INIT_LOGD(" Using default white black gamma threshold of %d", DEFAULT_TEXT_WHITE_GAMMA_THRESHOLD); } diff --git a/libs/hwui/GradientCache.cpp b/libs/hwui/GradientCache.cpp index a37964e..4a40a63 100644 --- a/libs/hwui/GradientCache.cpp +++ b/libs/hwui/GradientCache.cpp @@ -23,6 +23,7 @@ #include <utils/threads.h> +#include "Debug.h" #include "GradientCache.h" #include "Properties.h" @@ -38,10 +39,10 @@ GradientCache::GradientCache(): mSize(0), mMaxSize(MB(DEFAULT_GRADIENT_CACHE_SIZE)) { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_GRADIENT_CACHE_SIZE, property, NULL) > 0) { - LOGD(" Setting gradient cache size to %sMB", property); + INIT_LOGD(" Setting gradient cache size to %sMB", property); setMaxSize(MB(atof(property))); } else { - LOGD(" Using default gradient cache size of %.2fMB", DEFAULT_GRADIENT_CACHE_SIZE); + INIT_LOGD(" Using default gradient cache size of %.2fMB", DEFAULT_GRADIENT_CACHE_SIZE); } mCache.setOnEntryRemovedListener(this); diff --git a/libs/hwui/LayerCache.cpp b/libs/hwui/LayerCache.cpp index ec186a4..7667af5 100644 --- a/libs/hwui/LayerCache.cpp +++ b/libs/hwui/LayerCache.cpp @@ -20,6 +20,7 @@ #include <utils/Log.h> +#include "Debug.h" #include "LayerCache.h" #include "Properties.h" @@ -33,10 +34,10 @@ namespace uirenderer { LayerCache::LayerCache(): mSize(0), mMaxSize(MB(DEFAULT_LAYER_CACHE_SIZE)) { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_LAYER_CACHE_SIZE, property, NULL) > 0) { - LOGD(" Setting layer cache size to %sMB", property); + INIT_LOGD(" Setting layer cache size to %sMB", property); setMaxSize(MB(atof(property))); } else { - LOGD(" Using default layer cache size of %.2fMB", DEFAULT_LAYER_CACHE_SIZE); + INIT_LOGD(" Using default layer cache size of %.2fMB", DEFAULT_LAYER_CACHE_SIZE); } } diff --git a/libs/hwui/ShapeCache.h b/libs/hwui/ShapeCache.h index c8bcfc2..c627931 100644 --- a/libs/hwui/ShapeCache.h +++ b/libs/hwui/ShapeCache.h @@ -302,10 +302,10 @@ ShapeCache<Entry>::ShapeCache(const char* name, const char* propertyName, float mSize(0), mMaxSize(MB(defaultSize)) { char property[PROPERTY_VALUE_MAX]; if (property_get(propertyName, property, NULL) > 0) { - LOGD(" Setting %s cache size to %sMB", name, property); + INIT_LOGD(" Setting %s cache size to %sMB", name, property); setMaxSize(MB(atof(property))); } else { - LOGD(" Using default %s cache size of %.2fMB", name, defaultSize); + INIT_LOGD(" Using default %s cache size of %.2fMB", name, defaultSize); } size_t len = strlen(name); diff --git a/libs/hwui/TextDropShadowCache.cpp b/libs/hwui/TextDropShadowCache.cpp index d96a7f5..3256790 100644 --- a/libs/hwui/TextDropShadowCache.cpp +++ b/libs/hwui/TextDropShadowCache.cpp @@ -16,6 +16,7 @@ #define LOG_TAG "OpenGLRenderer" +#include "Debug.h" #include "TextDropShadowCache.h" #include "Properties.h" @@ -31,10 +32,11 @@ TextDropShadowCache::TextDropShadowCache(): mSize(0), mMaxSize(MB(DEFAULT_DROP_SHADOW_CACHE_SIZE)) { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_DROP_SHADOW_CACHE_SIZE, property, NULL) > 0) { - LOGD(" Setting drop shadow cache size to %sMB", property); + INIT_LOGD(" Setting drop shadow cache size to %sMB", property); setMaxSize(MB(atof(property))); } else { - LOGD(" Using default drop shadow cache size of %.2fMB", DEFAULT_DROP_SHADOW_CACHE_SIZE); + INIT_LOGD(" Using default drop shadow cache size of %.2fMB", + DEFAULT_DROP_SHADOW_CACHE_SIZE); } init(); diff --git a/libs/hwui/TextureCache.cpp b/libs/hwui/TextureCache.cpp index ebecebe..6fc2ddb 100644 --- a/libs/hwui/TextureCache.cpp +++ b/libs/hwui/TextureCache.cpp @@ -37,10 +37,10 @@ TextureCache::TextureCache(): mSize(0), mMaxSize(MB(DEFAULT_TEXTURE_CACHE_SIZE)) { char property[PROPERTY_VALUE_MAX]; if (property_get(PROPERTY_TEXTURE_CACHE_SIZE, property, NULL) > 0) { - LOGD(" Setting texture cache size to %sMB", property); + INIT_LOGD(" Setting texture cache size to %sMB", property); setMaxSize(MB(atof(property))); } else { - LOGD(" Using default texture cache size of %.2fMB", DEFAULT_TEXTURE_CACHE_SIZE); + INIT_LOGD(" Using default texture cache size of %.2fMB", DEFAULT_TEXTURE_CACHE_SIZE); } init(); |