Commit 2e559bbc by Jamie Madill

Do not allow context sharing between egl Displays.

This is an explicit error according to the EGL specification. ANGLEBUG=487 BUG= Test=WebGL CTS R=shannonwoods@chromium.org,geofflang@chromium.org
parent baa6116c
......@@ -819,20 +819,28 @@ EGLContext __stdcall eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLConte
return egl::error(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
}
egl::Display *display = static_cast<egl::Display*>(dpy);
if (share_context)
{
gl::Context* glContext = static_cast<gl::Context*>(share_context);
if (glContext->isResetNotificationEnabled() != reset_notification)
gl::Context* sharedGLContext = static_cast<gl::Context*>(share_context);
if (sharedGLContext->isResetNotificationEnabled() != reset_notification)
{
return egl::error(EGL_BAD_MATCH, EGL_NO_CONTEXT);
}
if (glContext->getClientVersion() != client_version)
if (sharedGLContext->getClientVersion() != client_version)
{
return egl::error(EGL_BAD_CONTEXT, EGL_NO_CONTEXT);
}
}
egl::Display *display = static_cast<egl::Display*>(dpy);
// Can not share contexts between displays
if (sharedGLContext->getRenderer() != display->getRenderer())
{
return egl::error(EGL_BAD_MATCH, EGL_NO_CONTEXT);
}
}
if (!validateConfig(display, config))
{
......
......@@ -38,7 +38,6 @@ class Renderer;
namespace egl
{
class Display;
class Surface;
}
......@@ -439,6 +438,8 @@ class Context
void invalidateFrameBuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments,
GLint x, GLint y, GLsizei width, GLsizei height);
rx::Renderer *getRenderer() { return mRenderer; }
private:
DISALLOW_COPY_AND_ASSIGN(Context);
......
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