ui: split the GL context in a different object

This will allow to have one GL context but a variable number of
listeners.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Marc-André Lureau 2021-10-09 23:48:46 +04:00
parent 7cc712e986
commit 5e79d516e8
14 changed files with 119 additions and 76 deletions

View file

@ -197,14 +197,14 @@ void gd_egl_switch(DisplayChangeListener *dcl,
}
}
QEMUGLContext gd_egl_create_context(DisplayChangeListener *dcl,
QEMUGLContext gd_egl_create_context(DisplayGLCtx *dgc,
QEMUGLParams *params)
{
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
VirtualConsole *vc = container_of(dgc, VirtualConsole, gfx.dgc);
eglMakeCurrent(qemu_egl_display, vc->gfx.esurface,
vc->gfx.esurface, vc->gfx.ectx);
return qemu_egl_create_context(dcl, params);
return qemu_egl_create_context(dgc, params);
}
void gd_egl_scanout_disable(DisplayChangeListener *dcl)
@ -360,10 +360,10 @@ void gtk_egl_init(DisplayGLMode mode)
display_opengl = 1;
}
int gd_egl_make_current(DisplayChangeListener *dcl,
int gd_egl_make_current(DisplayGLCtx *dgc,
QEMUGLContext ctx)
{
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
VirtualConsole *vc = container_of(dgc, VirtualConsole, gfx.dgc);
return eglMakeCurrent(qemu_egl_display, vc->gfx.esurface,
vc->gfx.esurface, ctx);