emulator opengles: Fixed a bug in eglChooseConfig implementation.

The config_size argument in rcChooseConfig should match the number
of requested configs and not the size in bytes to store it.
Moved the configs array size computation into rendeerControl.attrib.

Change-Id: I9e797024522965a656764c20252b25ff5ae657f5
diff --git a/tools/emulator/opengl/system/egl/egl.cpp b/tools/emulator/opengl/system/egl/egl.cpp
index d8ef8aa..698aa84 100644
--- a/tools/emulator/opengl/system/egl/egl.cpp
+++ b/tools/emulator/opengl/system/egl/egl.cpp
@@ -634,7 +634,7 @@
     }
 
     DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
-    *num_config = rcEnc->rcChooseConfig(rcEnc, (EGLint*)attrib_list, attribs_size * sizeof(EGLint), (uint32_t*)configs, config_size*sizeof(EGLint));
+    *num_config = rcEnc->rcChooseConfig(rcEnc, (EGLint*)attrib_list, attribs_size * sizeof(EGLint), (uint32_t*)configs, config_size);
 
     return EGL_TRUE;
 }
diff --git a/tools/emulator/opengl/system/renderControl_enc/renderControl.attrib b/tools/emulator/opengl/system/renderControl_enc/renderControl.attrib
index 4197d64..7baaf07 100644
--- a/tools/emulator/opengl/system/renderControl_enc/renderControl.attrib
+++ b/tools/emulator/opengl/system/renderControl_enc/renderControl.attrib
@@ -28,7 +28,7 @@
     dir attribs in
 	len attribs attribs_size
 	dir configs out
-	len configs configs_size
+	len configs configs_size*sizeof(uint32_t)
 
 rcReadColorBuffer
     dir pixels out