diff --git a/android/opengl/system/GLESv1/gl.cpp b/android/opengl/system/GLESv1/gl.cpp index 8aaf3472ea086235437b98112c3044c909a9e5b9..b0ae70e2b41dfedd5031b01586aa6f9b6e476954 100644 --- a/android/opengl/system/GLESv1/gl.cpp +++ b/android/opengl/system/GLESv1/gl.cpp @@ -27,6 +27,7 @@ //XXX: fix this macro to get the context from fast tls path #define GET_CONTEXT GLEncoder * ctx = getEGLThreadInfo()->hostConn->glEncoder(); +#define GET_CONTEXT_CHECK ALOGD("GET_CONTEXT_CHECK for compile"); #include "gl_entry.cpp" diff --git a/android/opengl/system/GLESv1_enc/gl_entry.cpp b/android/opengl/system/GLESv1_enc/gl_entry.cpp index 2b7fa9fefd9544e41c2117dfb53c6432f128605b..05c384f1296027c88bff08321b214e95c279c6b5 100644 --- a/android/opengl/system/GLESv1_enc/gl_entry.cpp +++ b/android/opengl/system/GLESv1_enc/gl_entry.cpp @@ -3,6 +3,7 @@ #include #include #include "gl_client_context.h" +#include #ifndef GL_TRUE extern "C" { @@ -304,6 +305,11 @@ extern "C" { static gl_client_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL; void gl_client_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; } #define GET_CONTEXT gl_client_context_t * ctx = getCurrentContext() +#define GET_CONTEXT_CHECK \ + if (getCurrentContext == NULL) { \ + ALOGE("GET_CONTEXT_CHECK getCurrentContext == NULL!!!"); \ + return; \ + } #endif void glAlphaFunc(GLenum func, GLclampf ref) @@ -724,6 +730,7 @@ void glEnable(GLenum cap) void glEnableClientState(GLenum array) { + GET_CONTEXT_CHECK; GET_CONTEXT; ctx->glEnableClientState(ctx, array); }