diff --git a/tools/emulator/opengl/Android.mk b/tools/emulator/opengl/Android.mk index 4ddce1977..a67facb3f 100644 --- a/tools/emulator/opengl/Android.mk +++ b/tools/emulator/opengl/Android.mk @@ -33,6 +33,10 @@ EMUGL_COMMON_INCLUDES := $(EMUGL_PATH)/host/include/libOpenglRender # EMUGL_COMMON_CFLAGS := -DWITH_GLES2 +# Uncomment the following line if you want to enable debug traces +# in the GLES emulation libraries. +# EMUGL_COMMON_CFLAGS += -DEMUGL_DEBUG=1 + # Include common definitions used by all the modules included later # in this build file. This contains the definition of all useful # emugl-xxxx functions. diff --git a/tools/emulator/opengl/host/libs/GLESv2_dec/GL2Decoder.cpp b/tools/emulator/opengl/host/libs/GLESv2_dec/GL2Decoder.cpp index 0457fdc07..e867cf87f 100644 --- a/tools/emulator/opengl/host/libs/GLESv2_dec/GL2Decoder.cpp +++ b/tools/emulator/opengl/host/libs/GLESv2_dec/GL2Decoder.cpp @@ -43,7 +43,7 @@ int GL2Decoder::initGL(get_proc_func_t getProcFunc, void *getProcFuncData) m_GL2library = osUtils::dynLibrary::open(libname); if (m_GL2library == NULL) { - fprintf(stderr, "Couldn't find %s \n", libname); + fprintf(stderr, "%s: Couldn't find %s \n", __FUNCTION__, libname); return -1; } this->initDispatchByName(s_getProc, this); @@ -77,7 +77,7 @@ void GL2Decoder::s_glGetCompressedTextureFormats(void *self, int count, GLint *f int nFormats; ctx->glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &nFormats); if (nFormats > count) { - fprintf(stderr, "GetCompressedTextureFormats: The requested number of formats does not match the number that is reported by OpenGL\n"); + fprintf(stderr, "%s: GetCompressedTextureFormats: The requested number of formats does not match the number that is reported by OpenGL\n", __FUNCTION__); } else { ctx->glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, formats); } diff --git a/tools/emulator/opengl/host/libs/libOpenglRender/RenderServer.cpp b/tools/emulator/opengl/host/libs/libOpenglRender/RenderServer.cpp index 3046db744..31f59c194 100644 --- a/tools/emulator/opengl/host/libs/libOpenglRender/RenderServer.cpp +++ b/tools/emulator/opengl/host/libs/libOpenglRender/RenderServer.cpp @@ -103,7 +103,7 @@ int RenderServer::Main() // insert the added thread to the list threads.insert(rt); - printf("Started new RenderThread\n"); + DBG("Started new RenderThread\n"); } // diff --git a/tools/emulator/opengl/shared/OpenglCodecCommon/ErrorLog.h b/tools/emulator/opengl/shared/OpenglCodecCommon/ErrorLog.h index 8502bb0e5..5e9c7b386 100644 --- a/tools/emulator/opengl/shared/OpenglCodecCommon/ErrorLog.h +++ b/tools/emulator/opengl/shared/OpenglCodecCommon/ErrorLog.h @@ -19,11 +19,19 @@ #if (HAVE_ANDROID_OS == 1) # include # define ERR(...) LOGE(__VA_ARGS__) -# define DBG(...) LOGD(__VA_ARGS__) +# ifdef EMUGL_DEBUG +# define DBG(...) LOGD(__VA_ARGS__) +# else +# define DBG(...) ((void)0) +# endif #else # include # define ERR(...) fprintf(stderr, __VA_ARGS__) -# define DBG(...) fprintf(stderr, __VA_ARGS__) +# ifdef EMUGL_DEBUG +# define DBG(...) fprintf(stderr, __VA_ARGS__) +# else +# define DBG(...) ((void)0) +# endif #endif #endif