Commit b4e00032 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=geofflang@chromium.org, shannonwoods@chromium.org Review URL: https://codereview.appspot.com/15690047
parent 5625f658
...@@ -819,13 +819,21 @@ EGLContext __stdcall eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLConte ...@@ -819,13 +819,21 @@ EGLContext __stdcall eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLConte
return egl::error(EGL_BAD_CONFIG, EGL_NO_CONTEXT); return egl::error(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
} }
if (share_context && static_cast<gl::Context*>(share_context)->isResetNotificationEnabled() != reset_notification) gl::Context *sharedContextPtr = (share_context != EGL_NO_CONTEXT ? static_cast<gl::Context*>(share_context) : NULL);
if (sharedContextPtr != NULL && sharedContextPtr->isResetNotificationEnabled() != reset_notification)
{ {
return egl::error(EGL_BAD_MATCH, EGL_NO_CONTEXT); return egl::error(EGL_BAD_MATCH, EGL_NO_CONTEXT);
} }
egl::Display *display = static_cast<egl::Display*>(dpy); egl::Display *display = static_cast<egl::Display*>(dpy);
// Can not share contexts between displays
if (sharedContextPtr != NULL && sharedContextPtr->getRenderer() != display->getRenderer())
{
return egl::error(EGL_BAD_MATCH, EGL_NO_CONTEXT);
}
if (!validateConfig(display, config)) if (!validateConfig(display, config))
{ {
return EGL_NO_CONTEXT; return EGL_NO_CONTEXT;
......
...@@ -37,7 +37,6 @@ class Renderer; ...@@ -37,7 +37,6 @@ class Renderer;
namespace egl namespace egl
{ {
class Display;
class Surface; class Surface;
} }
...@@ -398,6 +397,8 @@ class Context ...@@ -398,6 +397,8 @@ class Context
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask); GLbitfield mask);
rx::Renderer *getRenderer() { return mRenderer; }
private: private:
DISALLOW_COPY_AND_ASSIGN(Context); 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