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
diff --git a/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp b/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp
index dc8517c..29b4d64 100644
--- a/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp
+++ b/tools/emulator/opengl/host/libs/libOpenglRender/FBConfig.cpp
@@ -170,6 +170,15 @@
             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;