summaryrefslogtreecommitdiffstats
path: root/opengl/libs
diff options
context:
space:
mode:
authorMichael Lentine <mlentine@google.com>2014-09-23 19:16:54 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-09-23 19:16:54 +0000
commit53bffaaf277f8b9ebd1bffafe52f9a66b38fe792 (patch)
treedd48819b97f657162a592584af127d52ffb4e80f /opengl/libs
parent265f0d9dffb8b3d91c83991067abcd9684f2d712 (diff)
parent12c4bdad7b2372ab64dcd2abbdbe47e709fb8b90 (diff)
downloadframeworks_native-53bffaaf277f8b9ebd1bffafe52f9a66b38fe792.zip
frameworks_native-53bffaaf277f8b9ebd1bffafe52f9a66b38fe792.tar.gz
frameworks_native-53bffaaf277f8b9ebd1bffafe52f9a66b38fe792.tar.bz2
am 12c4bdad: Add rate-limited logging for unimplemented es functions.
* commit '12c4bdad7b2372ab64dcd2abbdbe47e709fb8b90': Add rate-limited logging for unimplemented es functions.
Diffstat (limited to 'opengl/libs')
-rw-r--r--opengl/libs/EGL/egl.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index 67fbae5..7c70fa0 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -330,12 +330,26 @@ EGLBoolean egl_init_drivers() {
return res;
}
+static pthread_mutex_t sLogPrintMutex = PTHREAD_MUTEX_INITIALIZER;
+static nsecs_t sLogPrintTime = 0;
+#define NSECS_DURATION 1000000000
+
void gl_unimplemented() {
- ALOGE("called unimplemented OpenGL ES API");
- char value[PROPERTY_VALUE_MAX];
- property_get("debug.egl.callstack", value, "0");
- if (atoi(value)) {
- CallStack stack(LOG_TAG);
+ bool printLog = false;
+ nsecs_t now = systemTime();
+ pthread_mutex_lock(&sLogPrintMutex);
+ if ((now - sLogPrintTime) > NSECS_DURATION) {
+ sLogPrintTime = now;
+ printLog = true;
+ }
+ pthread_mutex_unlock(&sLogPrintMutex);
+ if (printLog) {
+ ALOGE("called unimplemented OpenGL ES API");
+ char value[PROPERTY_VALUE_MAX];
+ property_get("debug.egl.callstack", value, "0");
+ if (atoi(value)) {
+ CallStack stack(LOG_TAG);
+ }
}
}