diff --git a/tools/emulator/opengl/tests/ut_renderer/Android.mk b/tools/emulator/opengl/tests/ut_renderer/Android.mk index 28317e9b3..e4c43a2ac 100644 --- a/tools/emulator/opengl/tests/ut_renderer/Android.mk +++ b/tools/emulator/opengl/tests/ut_renderer/Android.mk @@ -22,7 +22,8 @@ LOCAL_MODULE_TAGS := debug # is generated LOCAL_ADDITIONAL_DEPENDENCIES := \ $(HOST_OUT_SHARED_LIBRARIES)/libut_rendercontrol_dec$(HOST_SHLIB_SUFFIX) \ - $(HOST_OUT_SHARED_LIBRARIES)/libGLESv1_dec$(HOST_SHLIB_SUFFIX) + $(HOST_OUT_SHARED_LIBRARIES)/libGLESv1_dec$(HOST_SHLIB_SUFFIX) \ + $(HOST_OUT_SHARED_LIBRARIES)/libGLESv2_dec$(HOST_SHLIB_SUFFIX) LOCAL_SRC_FILES := ut_renderer.cpp \ RenderingThread.cpp \ @@ -43,14 +44,18 @@ LOCAL_CFLAGS := -DPVR_WAR #LOCAL_CFLAGS += -g -O0 LOCAL_C_INCLUDES := $(emulatorOpengl)/shared/OpenglCodecCommon \ + $(emulatorOpengl)/shared \ $(emulatorOpengl)/host/include/libOpenglRender \ - $(call intermediates-dir-for, SHARED_LIBRARIES, libut_rendercontrol_dec, HOST) \ - $(call intermediates-dir-for, SHARED_LIBRARIES, libGLESv1_dec, HOST) \ + $(call intermediates-dir-for, SHARED_LIBRARIES, libut_rendercontrol_dec, HOST) \ + $(call intermediates-dir-for, SHARED_LIBRARIES, libGLESv1_dec, HOST) \ + $(call intermediates-dir-for, SHARED_LIBRARIES, libGLESv2_dec, HOST) \ $(emulatorOpengl)/host/libs/GLESv1_dec \ + $(emulatorOpengl)/host/libs/GLESv2_dec \ $(emulatorOpengl)/system/GLESv1_enc \ + $(emulatorOpengl)/system/GLESv2_enc \ $(emulatorOpengl)/tests/ut_rendercontrol_enc -LOCAL_SHARED_LIBRARIES := libut_rendercontrol_dec libGLESv1_dec libEGL_host_wrapper +LOCAL_SHARED_LIBRARIES := libut_rendercontrol_dec libGLESv1_dec libGLESv2_dec libEGL_host_wrapper LOCAL_STATIC_LIBRARIES := \ libOpenglCodecCommon \ libcutils diff --git a/tools/emulator/opengl/tests/ut_renderer/Renderer.cpp b/tools/emulator/opengl/tests/ut_renderer/Renderer.cpp index edfdd6419..22afadb82 100644 --- a/tools/emulator/opengl/tests/ut_renderer/Renderer.cpp +++ b/tools/emulator/opengl/tests/ut_renderer/Renderer.cpp @@ -147,6 +147,7 @@ int Renderer::makeCurrent(RenderingThread *thread, eglContext = c->second->eglContext(); thread->setCurrentContext(c->second); thread->glDecoder().setContextData(&c->second->decoderContextData()); + thread->gl2Decoder().setContextData(&c->second->decoderContextData()); } else { // same context is already set eglContext = c->second->eglContext(); @@ -156,6 +157,7 @@ int Renderer::makeCurrent(RenderingThread *thread, if (currentContext != NULL) currentContext->unref(); thread->setCurrentContext(NULL); thread->glDecoder().setContextData(NULL); + thread->gl2Decoder().setContextData(NULL); } EGLSurface draw = EGL_NO_SURFACE; diff --git a/tools/emulator/opengl/tests/ut_renderer/RenderingThread.cpp b/tools/emulator/opengl/tests/ut_renderer/RenderingThread.cpp index cf1d070f1..546c62d56 100644 --- a/tools/emulator/opengl/tests/ut_renderer/RenderingThread.cpp +++ b/tools/emulator/opengl/tests/ut_renderer/RenderingThread.cpp @@ -312,6 +312,8 @@ void *RenderingThread::thread() m_glDisableClientState = m_glDec.set_glDisableClientState(s_glDisableClientState); #endif + m_gl2Dec.initGL(); + m_utDec.set_swapBuffers(s_swapBuffers); m_utDec.set_createContext(s_createContext); m_utDec.set_destroyContext(s_destroyContext); @@ -359,6 +361,14 @@ void *RenderingThread::thread() } } + if (readBuf.validData() >= 8) { + size_t last = m_gl2Dec.decode(readBuf.buf(), readBuf.validData(), m_stream); + if (last > 0) { + readBuf.consume(last); + progress = true; + } + } + if (readBuf.validData() >= 8) { size_t last = m_utDec.decode(readBuf.buf(), readBuf.validData(), m_stream); if (last > 0) { diff --git a/tools/emulator/opengl/tests/ut_renderer/RenderingThread.h b/tools/emulator/opengl/tests/ut_renderer/RenderingThread.h index 19b3060b2..ca8f6f494 100644 --- a/tools/emulator/opengl/tests/ut_renderer/RenderingThread.h +++ b/tools/emulator/opengl/tests/ut_renderer/RenderingThread.h @@ -18,6 +18,7 @@ #include "TcpStream.h" #include "GLDecoder.h" +#include "GL2Decoder.h" #include "ut_rendercontrol_dec.h" #include @@ -43,12 +44,15 @@ public: RendererContext *currentContext() { return m_currentContext; } void setCurrentContext(RendererContext *ctx) { m_currentContext = ctx; } GLDecoder & glDecoder() { return m_glDec; } + GL2Decoder & gl2Decoder() { return m_gl2Dec; } + private: void initBackendCaps(); private: GLDecoder m_glDec; ut_rendercontrol_decoder_context_t m_utDec; + GL2Decoder m_gl2Dec; TcpStream *m_stream; pthread_t m_thread;