Context: Bind current display/surface.
Looking at the EGL spec, it says for eglGetCurrentDisplay:
"The display for the current context in the calling thread, for the
current rendering API, is returned."
This implies that MakeCurrent binds a display to a Context. There's
also pretty clear language for the read/draw Surface as well, that
they can only be bound to one Context/thread at a time. Hence we
don't need to duplicate this storage in the egl::Thread structure,
merely storing a pointer to the current Context, which has access
to the read/draw Surface and current Display.
BUG=angleproject:1156
Change-Id: Ia3b99d50b3591012c43e851834c1af02ff62a33f
Reviewed-on: https://chromium-review.googlesource.com/538865
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index bfdbc07..2fdb17e 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -3361,7 +3361,6 @@
}
bool ValidateEGLImageTargetTexture2DOES(Context *context,
- egl::Display *display,
GLenum target,
egl::Image *image)
{
@@ -3394,7 +3393,8 @@
return false;
}
- if (!display->isValidImage(image))
+ ASSERT(context->getCurrentDisplay());
+ if (!context->getCurrentDisplay()->isValidImage(image))
{
context->handleError(InvalidValue() << "EGL image is not valid.");
return false;
@@ -3420,7 +3420,6 @@
}
bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context,
- egl::Display *display,
GLenum target,
egl::Image *image)
{
@@ -3440,7 +3439,8 @@
return false;
}
- if (!display->isValidImage(image))
+ ASSERT(context->getCurrentDisplay());
+ if (!context->getCurrentDisplay()->isValidImage(image))
{
context->handleError(InvalidValue() << "EGL image is not valid.");
return false;