mirror of
https://github.com/brl/mutter.git
synced 2025-03-28 22:23:47 +00:00
Don't bother trying to accept NULL in _cogl_winsys_onscreen_bind
The GLX and EGL winsys backends had a check for when onscreen==NULL in which case they would instead try to bind the dummy surface. This wouldn't work however because it would have already crashed by that point when it tried to get the Cogl context out of the onscreen. The function needs a bit of refactoring before it could support this but presumably nothing is relying on this anyway because it wouldn't work so for now we can just remove it. Reviewed-by: Robert Bragg <robert@linux.intel.com>
This commit is contained in:
parent
7f74712a79
commit
a72a2c99fe
@ -1507,28 +1507,11 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
|
||||
if (egl_context->current_surface == egl_onscreen->egl_surface)
|
||||
return;
|
||||
|
||||
if (G_UNLIKELY (!onscreen))
|
||||
{
|
||||
if (renderer->winsys_vtable->id == COGL_WINSYS_ID_EGL_X11 ||
|
||||
renderer->winsys_vtable->id == COGL_WINSYS_ID_EGL_WAYLAND)
|
||||
{
|
||||
eglMakeCurrent (egl_renderer->edpy,
|
||||
egl_display->dummy_surface,
|
||||
egl_display->dummy_surface,
|
||||
egl_display->egl_context);
|
||||
egl_context->current_surface = egl_display->dummy_surface;
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
eglMakeCurrent (egl_renderer->edpy,
|
||||
egl_onscreen->egl_surface,
|
||||
egl_onscreen->egl_surface,
|
||||
egl_display->egl_context);
|
||||
egl_context->current_surface = egl_onscreen->egl_surface;
|
||||
}
|
||||
|
||||
if (onscreen->swap_throttled)
|
||||
eglSwapInterval (egl_renderer->edpy, 1);
|
||||
|
@ -1034,23 +1034,6 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
|
||||
CoglXlibTrapState old_state;
|
||||
GLXDrawable drawable;
|
||||
|
||||
if (G_UNLIKELY (!onscreen))
|
||||
{
|
||||
drawable =
|
||||
glx_display->dummy_glxwin ?
|
||||
glx_display->dummy_glxwin : glx_display->dummy_xwin;
|
||||
|
||||
if (glx_context->current_drawable == drawable)
|
||||
return;
|
||||
|
||||
_cogl_xlib_renderer_trap_errors (context->display->renderer, &old_state);
|
||||
|
||||
glx_renderer->glXMakeContextCurrent (xlib_renderer->xdpy,
|
||||
drawable, drawable,
|
||||
glx_display->glx_context);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawable =
|
||||
glx_onscreen->glxwin ? glx_onscreen->glxwin : xlib_onscreen->xwin;
|
||||
|
||||
@ -1098,7 +1081,6 @@ _cogl_winsys_onscreen_bind (CoglOnscreen *onscreen)
|
||||
else
|
||||
glx_renderer->pf_glXSwapInterval (0);
|
||||
}
|
||||
}
|
||||
|
||||
XSync (xlib_renderer->xdpy, False);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user