Add the EGL display as a context member.

This prevents having to access the current display though TLS.

Change-Id: Ic93d0f88096a7e7e50318dbafb9b32da5fbc50a2
Reviewed-on: https://swiftshader-review.googlesource.com/5511
Tested-by: Nicolas Capens <capn@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Reviewed-by: Meng-Lin Wu <marleymoo@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 8650d84..ba34dab 100644
--- a/src/OpenGL/libGLES_CM/Context.cpp
+++ b/src/OpenGL/libGLES_CM/Context.cpp
@@ -37,8 +37,9 @@
 
 namespace es1
 {
-Context::Context(const egl::Config *config, const Context *shareContext)
-	: modelViewStack(MAX_MODELVIEW_STACK_DEPTH),
+Context::Context(egl::Display *const display, const egl::Config *config, const Context *shareContext)
+	: egl::Context(display),
+	  modelViewStack(MAX_MODELVIEW_STACK_DEPTH),
 	  projectionStack(MAX_PROJECTION_STACK_DEPTH),
 	  textureStack0(MAX_TEXTURE_STACK_DEPTH),
 	  textureStack1(MAX_TEXTURE_STACK_DEPTH)
@@ -3446,8 +3447,8 @@
 
 }
 
-egl::Context *es1CreateContext(const egl::Config *config, const egl::Context *shareContext)
+egl::Context *es1CreateContext(egl::Display *display, const egl::Config *config, const egl::Context *shareContext)
 {
 	ASSERT(!shareContext || shareContext->getClientVersion() == 1);   // Should be checked by eglCreateContext
-	return new es1::Context(config, static_cast<const es1::Context*>(shareContext));
+	return new es1::Context(display, config, static_cast<const es1::Context*>(shareContext));
 }