From 455e3601498096d1daa0cf0ec7c23abb28b39af3 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 26 Sep 2012 17:19:48 -0700 Subject: [PATCH] assert -eng builds when calling a GL function without a context Bug: 7241626 Change-Id: I0f1f9361e75e9186af8cff8d98a7d2224b266765 --- opengl/libs/EGL/egl.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp index b658240c0..7ca210c2f 100644 --- a/opengl/libs/EGL/egl.cpp +++ b/opengl/libs/EGL/egl.cpp @@ -166,8 +166,13 @@ void setGLHooksThreadSpecific(gl_hooks_t const *value) { static int gl_no_context() { if (egl_tls_t::logNoContextCall()) { - ALOGE("call to OpenGL ES API with no current context " - "(logged once per thread)"); + char const* const error = "call to OpenGL ES API with " + "no current context (logged once per thread)"; + if (LOG_NDEBUG) { + ALOGE(error); + } else { + LOG_ALWAYS_FATAL(error); + } char value[PROPERTY_VALUE_MAX]; property_get("debug.egl.callstack", value, "0"); if (atoi(value)) {