Pass the Renderer to the Context at construction time

TRAC #22000 Signed-off-by: Daniel Koch Author: Shannon Woods git-svn-id: https://angleproject.googlecode.com/svn/branches/dx11proto@1402 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 222ee081
......@@ -383,7 +383,7 @@ EGLContext Display::createContext(EGLConfig configHandle, const gl::Context *sha
return NULL;
}
gl::Context *context = glCreateContext(shareContext, notifyResets, robustAccess);
gl::Context *context = glCreateContext(shareContext, mRenderer, notifyResets, robustAccess);
mContextSet.insert(context);
return context;
......
......@@ -36,10 +36,13 @@
namespace gl
{
Context::Context(const gl::Context *shareContext, bool notifyResets, bool robustAccess)
Context::Context(const gl::Context *shareContext, rx::Renderer *renderer, bool notifyResets, bool robustAccess)
{
ASSERT(robustAccess == false); // Unimplemented
ASSERT(dynamic_cast<rx::Renderer9*>(renderer) != NULL); // D3D9_REPLACE
mRenderer = static_cast<rx::Renderer9*>(renderer);
mDisplay = NULL;
mDevice = NULL;
......@@ -4373,9 +4376,9 @@ void VertexDeclarationCache::markStateDirty()
extern "C"
{
gl::Context *glCreateContext(const gl::Context *shareContext, bool notifyResets, bool robustAccess)
gl::Context *glCreateContext(const gl::Context *shareContext, rx::Renderer *renderer, bool notifyResets, bool robustAccess)
{
return new gl::Context(shareContext, notifyResets, robustAccess);
return new gl::Context(shareContext, renderer, notifyResets, robustAccess);
}
void glDestroyContext(gl::Context *context)
......
......@@ -278,7 +278,7 @@ class VertexDeclarationCache
class Context
{
public:
Context(const gl::Context *shareContext, bool notifyResets, bool robustAccess);
Context(const gl::Context *shareContext, rx::Renderer *renderer, bool notifyResets, bool robustAccess);
~Context();
......
......@@ -48,7 +48,7 @@ const T &error(GLenum errorCode, const T &returnValue)
extern "C"
{
// Exported functions for use by EGL
gl::Context *glCreateContext(const gl::Context *shareContext, bool notifyResets, bool robustAccess);
gl::Context *glCreateContext(const gl::Context *shareContext, rx::Renderer *renderer, bool notifyResets, bool robustAccess);
void glDestroyContext(gl::Context *context);
void glMakeCurrent(gl::Context *context, egl::Display *display, egl::Surface *surface);
gl::Context *glGetCurrentContext();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment