From 2a4aa00b0f579a3be0e8449914e65c9329253611 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Thu, 17 Apr 2014 12:12:46 +0200 Subject: emulator/opengl: Backport fixes from master branch. This back-ports several fixes from aosp/master branch into idea133: 145e25 Fix the Google Maps crash issue e33909 Support GL_MAX_TEXTURE_SIZE case to glGetIntegerv API c6dd20 Fix Mac build. Change-Id: I26a05956c3b926dddeb638c6cff979199075ecbb --- emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'emulator/opengl/host/libs/Translator/GLES_V2') diff --git a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp index c96ba52..fe64f6f 100644 --- a/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp +++ b/emulator/opengl/host/libs/Translator/GLES_V2/GLESv2Imp.cpp @@ -940,11 +940,19 @@ GL_APICALL void GL_APIENTRY glGetFloatv(GLenum pname, GLfloat* params){ } GL_APICALL void GL_APIENTRY glGetIntegerv(GLenum pname, GLint* params){ + int destroyCtx = 0; GET_CTX(); + if (!ctx) { + ctx = createGLESContext(); + if (ctx) + destroyCtx = 1; + } if (ctx->glGetIntegerv(pname,params)) { - return; + if (destroyCtx) + deleteGLESContext(ctx); + return; } bool es2 = ctx->getCaps()->GL_ARB_ES2_COMPATIBILITY; @@ -1030,6 +1038,8 @@ GL_APICALL void GL_APIENTRY glGetIntegerv(GLenum pname, GLint* params){ default: ctx->dispatcher().glGetIntegerv(pname,params); } + if (destroyCtx) + deleteGLESContext(ctx); } GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params){ -- cgit v1.1