OSDN Git Service

Log only 1 line per process when using OpenGLRenderer.
authorRomain Guy <romainguy@google.com>
Sat, 22 Jan 2011 05:14:15 +0000 (21:14 -0800)
committerRomain Guy <romainguy@google.com>
Sat, 22 Jan 2011 05:14:15 +0000 (21:14 -0800)
Change-Id: Idbdd6b84f31301e58ed53e0d50fd61fece192dfa

libs/hwui/Caches.h
libs/hwui/Debug.h
libs/hwui/FboCache.cpp
libs/hwui/FontRenderer.cpp
libs/hwui/GammaFontRenderer.cpp
libs/hwui/GradientCache.cpp
libs/hwui/LayerCache.cpp
libs/hwui/ShapeCache.h
libs/hwui/TextDropShadowCache.cpp
libs/hwui/TextureCache.cpp

index aa0ceb7..24585d5 100644 (file)
@@ -69,7 +69,7 @@ static const GLsizei gMeshCount = 4;
 
 struct CacheLogger {
     CacheLogger() {
-        LOGD("Creating caches");
+        LOGD("Creating OpenGL renderer caches");
     }
 }; // struct CacheLogger
 
index 6236684..14471bc 100644 (file)
@@ -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
 
 // 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
index 2ef71c2..beef7be 100644 (file)
@@ -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);
     }
 }
 
index c43e40d..0042f49 100644 (file)
@@ -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);
         }
     }
 
index 6d087e3..e8362dc 100644 (file)
@@ -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);
     }
 
index a37964e..4a40a63 100644 (file)
@@ -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);
index ec186a4..7667af5 100644 (file)
@@ -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);
     }
 }
 
index c8bcfc2..c627931 100644 (file)
@@ -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);
index d96a7f5..3256790 100644 (file)
@@ -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();
index ebecebe..6fc2ddb 100644 (file)
@@ -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();