struct CacheLogger {
CacheLogger() {
- LOGD("Creating caches");
+ LOGD("Creating OpenGL renderer caches");
}
}; // struct CacheLogger
// 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
#include <stdlib.h>
+#include "Debug.h"
#include "FboCache.h"
#include "Properties.h"
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);
}
}
#include <utils/Log.h>
+#include "Debug.h"
#include "FontRenderer.h"
namespace android {
static bool sLogFontRendererCreate = true;
FontRenderer::FontRenderer() {
- if (sLogFontRendererCreate) LOGD("Creating FontRenderer");
+ if (sLogFontRendererCreate) {
+ INIT_LOGD("Creating FontRenderer");
+ }
mGammaTable = NULL;
mInitialized = false;
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);
}
}
#define LOG_TAG "OpenGLRenderer"
+#include "Debug.h"
#include "GammaFontRenderer.h"
#include "Properties.h"
///////////////////////////////////////////////////////////////////////////////
GammaFontRenderer::GammaFontRenderer() {
- LOGD("Creating gamma font renderer");
+ INIT_LOGD("Creating gamma font renderer");
// Get the renderer properties
char property[PROPERTY_VALUE_MAX];
// 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);
}
#include <utils/threads.h>
+#include "Debug.h"
#include "GradientCache.h"
#include "Properties.h"
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);
#include <utils/Log.h>
+#include "Debug.h"
#include "LayerCache.h"
#include "Properties.h"
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);
}
}
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);
#define LOG_TAG "OpenGLRenderer"
+#include "Debug.h"
#include "TextDropShadowCache.h"
#include "Properties.h"
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();
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();