diff --git a/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp b/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp index fdf5433be..7c8edc0f6 100644 --- a/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp +++ b/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp @@ -268,14 +268,14 @@ int FBConfig::chooseConfig(FrameBuffer *fb, EGLint * attribs, uint32_t * configs // uint32_t nVerifiedCfgs = 0; for (int matchedIdx=0; matchedIdx 0) && (nVerifiedCfgs >= configs_size)) break; //We have enouhgt configs + if ((configs != NULL) && (configs_size > 0) && (nVerifiedCfgs >= configs_size)) break; //We have enouhgt configs int sCfgId; s_egl.eglGetConfigAttrib(dpy, matchedConfigs[matchedIdx], EGL_CONFIG_ID, &sCfgId); for (int fbIdx=0; fbIdxm_attribValues[4]; //CONFIG_ID if (sCfgId == dCfgId) { //This config matches the requested attributes and filtered into fbConfigs, so we're happy with it - if (nVerifiedCfgs < configs_size) { + if (configs && nVerifiedCfgs < configs_size) { configs[nVerifiedCfgs] = fbIdx; } nVerifiedCfgs++; diff --git a/tools/emulator/opengl/system/OpenglSystemCommon/QemuPipeStream.cpp b/tools/emulator/opengl/system/OpenglSystemCommon/QemuPipeStream.cpp index b632d84f4..50c3d8bb1 100644 --- a/tools/emulator/opengl/system/OpenglSystemCommon/QemuPipeStream.cpp +++ b/tools/emulator/opengl/system/OpenglSystemCommon/QemuPipeStream.cpp @@ -117,7 +117,7 @@ const unsigned char *QemuPipeStream::readFully(void *buf, size_t len) //DBG(">> QemuPipeStream::readFully %d\n", len); if (!valid()) return NULL; if (!buf) { - ERR("QemuPipeStream::readFully failed, buf=NULL, len %d", len); + if (len>0) ERR("QemuPipeStream::readFully failed, buf=NULL, len %d", len); return NULL; // do not allow NULL buf in that implementation } size_t res = len; diff --git a/tools/emulator/opengl/system/egl/egl.cpp b/tools/emulator/opengl/system/egl/egl.cpp index f8633fdca..79fffe96e 100644 --- a/tools/emulator/opengl/system/egl/egl.cpp +++ b/tools/emulator/opengl/system/egl/egl.cpp @@ -808,7 +808,12 @@ EGLBoolean eglQuerySurface(EGLDisplay dpy, EGLSurface eglSurface, EGLint attribu case EGL_SWAP_BEHAVIOR: *value = surface->getSwapBehavior(); break; - //TODO: complete other attributes + case EGL_LARGEST_PBUFFER: + // not modified for a window or pixmap surface + // and we ignore it when creating a PBuffer surface (default is EGL_FALSE) + if (surface->getSurfaceType() & EGL_PBUFFER_BIT) *value = EGL_FALSE; + break; + //TODO: complete other attributes default: LOGE("eglQuerySurface %x EGL_BAD_ATTRIBUTE", attribute); ret = setErrorFunc(EGL_BAD_ATTRIBUTE, EGL_FALSE); @@ -987,9 +992,8 @@ EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLC // EGLThreadInfo *tInfo = getEGLThreadInfo(); if (tInfo->currentContext == context && - context && - context->draw == draw && - context->read == read) { + (context == NULL || + (context && context->draw == draw && context->read == read))) { return EGL_TRUE; } diff --git a/tools/emulator/opengl/system/renderControl_enc/renderControl.attrib b/tools/emulator/opengl/system/renderControl_enc/renderControl.attrib index 7baaf0752..c51ae0eef 100644 --- a/tools/emulator/opengl/system/renderControl_enc/renderControl.attrib +++ b/tools/emulator/opengl/system/renderControl_enc/renderControl.attrib @@ -28,6 +28,7 @@ rcChooseConfig dir attribs in len attribs attribs_size dir configs out + var_flag configs nullAllowed len configs configs_size*sizeof(uint32_t) rcReadColorBuffer