From 0e8bbee5775d81c7bbc479b995496cac9238559f Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 5 Oct 2011 19:15:05 -0700 Subject: [PATCH] don't log EGL errors due to unimplemented proprietary extensions Change-Id: Icfc33d4f55d1e7fb49390ce0921ba37a438c9fc2 --- opengl/libs/EGL/eglApi.cpp | 4 ++-- opengl/libs/EGL/egl_tls.cpp | 22 +++++++++++++--------- opengl/libs/EGL/egl_tls.h | 13 +++++++++---- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index 23f67d54a..1f9ce68ee 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -1480,7 +1480,7 @@ EGLuint64NV eglGetSystemTimeFrequencyNV() } } - return setError(EGL_BAD_DISPLAY, 0);; + return setErrorQuiet(EGL_BAD_DISPLAY, 0); } EGLuint64NV eglGetSystemTimeNV() @@ -1500,5 +1500,5 @@ EGLuint64NV eglGetSystemTimeNV() } } - return setError(EGL_BAD_DISPLAY, 0);; + return setErrorQuiet(EGL_BAD_DISPLAY, 0); } diff --git a/opengl/libs/EGL/egl_tls.cpp b/opengl/libs/EGL/egl_tls.cpp index f3c8d2c78..b341ddbc7 100644 --- a/opengl/libs/EGL/egl_tls.cpp +++ b/opengl/libs/EGL/egl_tls.cpp @@ -67,19 +67,23 @@ void egl_tls_t::validateTLSKey() } } -void egl_tls_t::setErrorEtcImpl(const char* caller, int line, EGLint error) { +void egl_tls_t::setErrorEtcImpl( + const char* caller, int line, EGLint error, bool quiet) { validateTLSKey(); egl_tls_t* tls = getTLS(); if (tls->error != error) { - LOGE("%s:%d error %x (%s)", caller, line, error, egl_strerror(error)); - tls->error = error; - char value[PROPERTY_VALUE_MAX]; - property_get("debug.egl.callstack", value, "0"); - if (atoi(value)) { - CallStack stack; - stack.update(); - stack.dump(); + if (!quiet) { + LOGE("%s:%d error %x (%s)", + caller, line, error, egl_strerror(error)); + char value[PROPERTY_VALUE_MAX]; + property_get("debug.egl.callstack", value, "0"); + if (atoi(value)) { + CallStack stack; + stack.update(); + stack.dump(); + } } + tls->error = error; } } diff --git a/opengl/libs/EGL/egl_tls.h b/opengl/libs/EGL/egl_tls.h index a7989ef96..78b0b2fe5 100644 --- a/opengl/libs/EGL/egl_tls.h +++ b/opengl/libs/EGL/egl_tls.h @@ -41,7 +41,8 @@ class egl_tls_t { egl_tls_t(); static void validateTLSKey(); - static void setErrorEtcImpl(const char* caller, int line, EGLint error); + static void setErrorEtcImpl( + const char* caller, int line, EGLint error, bool quiet); public: static egl_tls_t* getTLS(); @@ -55,13 +56,17 @@ public: template static T setErrorEtc(const char* caller, - int line, EGLint error, T returnValue) { - setErrorEtcImpl(caller, line, error); + int line, EGLint error, T returnValue, bool quiet = false) { + setErrorEtcImpl(caller, line, error, quiet); return returnValue; } }; -#define setError(_e, _r) egl_tls_t::setErrorEtc(__FUNCTION__, __LINE__, _e, _r) +#define setError(_e, _r) \ + egl_tls_t::setErrorEtc(__FUNCTION__, __LINE__, _e, _r) + +#define setErrorQuiet(_e, _r) \ + egl_tls_t::setErrorEtc(__FUNCTION__, __LINE__, _e, _r, true) // ----------------------------------------------------------------------------