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
This commit is contained in:
Guy Zadickario
2011-08-07 13:44:03 +03:00
committed by David 'Digit' Turner
parent 52829d82ab
commit f1d98dd318

View File

@@ -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;