mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
ui: add egl dmabuf import to gtkglarea
GtkGLArea is used on wayland, where EGL is usually available. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210204105232.834642-17-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
52a37e20db
commit
2606519b74
3 changed files with 42 additions and 0 deletions
|
@ -213,6 +213,24 @@ void gd_gl_area_scanout_flush(DisplayChangeListener *dcl,
|
|||
gtk_gl_area_queue_render(GTK_GL_AREA(vc->gfx.drawing_area));
|
||||
}
|
||||
|
||||
void gd_gl_area_scanout_dmabuf(DisplayChangeListener *dcl,
|
||||
QemuDmaBuf *dmabuf)
|
||||
{
|
||||
#ifdef CONFIG_OPENGL_DMABUF
|
||||
VirtualConsole *vc = container_of(dcl, VirtualConsole, gfx.dcl);
|
||||
|
||||
gtk_gl_area_make_current(GTK_GL_AREA(vc->gfx.drawing_area));
|
||||
egl_dmabuf_import_texture(dmabuf);
|
||||
if (!dmabuf->texture) {
|
||||
return;
|
||||
}
|
||||
|
||||
gd_gl_area_scanout_texture(dcl, dmabuf->texture,
|
||||
false, dmabuf->width, dmabuf->height,
|
||||
0, 0, dmabuf->width, dmabuf->height);
|
||||
#endif
|
||||
}
|
||||
|
||||
void gtk_gl_area_init(void)
|
||||
{
|
||||
display_opengl = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue