Implement eglQueryContext.

Bug b/37991302

Change-Id: I8a1c28d4a9c8968be3a04da64a19ddd3f5274dd6
Reviewed-on: https://swiftshader-review.googlesource.com/9768
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Nicolas Capens <capn@google.com>
diff --git a/src/OpenGL/libGLES_CM/Context.cpp b/src/OpenGL/libGLES_CM/Context.cpp
index 1a4ed35..78fcec5 100644
--- a/src/OpenGL/libGLES_CM/Context.cpp
+++ b/src/OpenGL/libGLES_CM/Context.cpp
@@ -37,8 +37,8 @@
 
 namespace es1
 {
-Context::Context(egl::Display *const display, const Context *shareContext)
-	: egl::Context(display),
+Context::Context(egl::Display *const display, const Context *shareContext, const egl::Config *config)
+	: egl::Context(display), config(config),
 	  modelViewStack(MAX_MODELVIEW_STACK_DEPTH),
 	  projectionStack(MAX_PROJECTION_STACK_DEPTH),
 	  textureStack0(MAX_TEXTURE_STACK_DEPTH),
@@ -321,11 +321,16 @@
 	markAllStateDirty();
 }
 
-int Context::getClientVersion() const
+EGLint Context::getClientVersion() const
 {
 	return 1;
 }
 
+EGLint Context::getConfigID() const
+{
+	return config->mConfigID;
+}
+
 // This function will set all of the state-related dirty flags, so that all state is set during next pre-draw.
 void Context::markAllStateDirty()
 {
@@ -3470,8 +3475,8 @@
 
 }
 
-egl::Context *es1CreateContext(egl::Display *display, const egl::Context *shareContext)
+egl::Context *es1CreateContext(egl::Display *display, const egl::Context *shareContext, const egl::Config *config)
 {
 	ASSERT(!shareContext || shareContext->getClientVersion() == 1);   // Should be checked by eglCreateContext
-	return new es1::Context(display, static_cast<const es1::Context*>(shareContext));
+	return new es1::Context(display, static_cast<const es1::Context*>(shareContext), config);
 }