Merge "don't log EGL errors due to unimplemented proprietary extensions"

This commit is contained in:
Mathias Agopian 2011-10-07 15:38:50 -07:00 committed by Android (Google) Code Review
commit cb061fd9da
3 changed files with 24 additions and 15 deletions

View File

@ -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);
}

View File

@ -67,12 +67,14 @@ 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;
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)) {
@ -81,6 +83,8 @@ void egl_tls_t::setErrorEtcImpl(const char* caller, int line, EGLint error) {
stack.dump();
}
}
tls->error = error;
}
}
bool egl_tls_t::logNoContextCall() {

View File

@ -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<typename T>
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)
// ----------------------------------------------------------------------------