From f1d98dd318ee628e12ed61dbfe967202e9a97ab7 Mon Sep 17 00:00:00 2001 From: Guy Zadickario Date: Sun, 7 Aug 2011 13:44:03 +0300 Subject: [PATCH] opengles emulator: filter-out non-RGB configs some applications and conformance tests expects to have non-zero bit counts for all red,green and blue channels. The translator expose all EGL compliant configs, including monochrome and RG configs. We now filter those out and expose to the guest only the RGB configs. Change-Id: I9a293675359135a548ce1c089f31a48ea2b7f46e --- .../opengl/host/libs/libOpenglRender/FBConfig.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp b/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp index dc8517c6c..29b4d6426 100644 --- a/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp +++ b/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp @@ -170,6 +170,15 @@ InitConfigStatus FBConfig::initConfigList(FrameBuffer *fb) if (!(surfaceType & EGL_PBUFFER_BIT)) continue; } + // + // Filter out not RGB configs + // + EGLint redSize, greenSize, blueSize; + s_egl.eglGetConfigAttrib(dpy, configs[i], EGL_RED_SIZE, &redSize); + s_egl.eglGetConfigAttrib(dpy, configs[i], EGL_BLUE_SIZE, &blueSize); + s_egl.eglGetConfigAttrib(dpy, configs[i], EGL_GREEN_SIZE, &greenSize); + if (redSize==0 || greenSize==0 || blueSize==0) continue; + s_fbConfigs[j++] = new FBConfig(dpy, configs[i]); } s_numConfigs = j;