Merge remote-tracking branch 'upstream/master' into 10bit-color

This commit is contained in:
DerVerruckteFuchs 2020-07-19 22:39:11 -04:00
commit e9855a3571
14 changed files with 505 additions and 30 deletions

View file

@ -459,7 +459,20 @@ void wlr_egl_save_context(struct wlr_egl_context *context) {
}
bool wlr_egl_restore_context(struct wlr_egl_context *context) {
return eglMakeCurrent(context->display, context->draw_surface,
// If the saved context is a null-context, we must use the current
// display instead of the saved display because eglMakeCurrent() can't
// handle EGL_NO_DISPLAY.
EGLDisplay display = context->display == EGL_NO_DISPLAY ?
eglGetCurrentDisplay() : context->display;
// If the current display is also EGL_NO_DISPLAY, we assume that there
// is currently no context set and no action needs to be taken to unset
// the context.
if (display == EGL_NO_DISPLAY) {
return true;
}
return eglMakeCurrent(display, context->draw_surface,
context->read_surface, context->context);
}