On 20.05.2015 17:19, Gerd Hoffmann wrote:
This adds opengl rendering support to the gtk ui, using egl.
It's off by default for now, use 'qemu -display gtk,gl=on'
to play with this.
Note that gtk got native opengl support with release 3.16.
There most likely will be a separate implementation for 3.16+,
using the native gtk opengl support. This patch covers older
versions (and for the time being 3.16 too, hopefully without
rendering quirks).
Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
---
include/ui/console.h | 2 +-
include/ui/gtk.h | 23 +++++++++
ui/Makefile.objs | 3 ++
ui/gtk-egl.c | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++
ui/gtk.c | 77 ++++++++++++++++++++++------
vl.c | 11 +++-
6 files changed, 240 insertions(+), 17 deletions(-)
create mode 100644 ui/gtk-egl.c
I do see the quandary with gtk 3.14 and 3.15
(gtk_widget_set_double_buffered() is deprecated, but we need it), but
the problem is, with this patch, you simply cannot compile qemu on a gtk
3.14+ system with --with-gtkabi=3.0 and without --disable-opengl, which
I don't think is right.
So at least the commit message is wrong, this patch does not cover 3.16.
It would without -Werror (or with -Wno-deprecated-declarations), but
that's enabled by default.
Once the native OpenGL support introduced by 3.16 is used, at least
that'll be covered, but we'll still have to deal with 3.14 and 3.15. I
think the right thing to do is to make configure disable OpenGL support
if gtk 3.14+ is to be used (in the future, that would be 3.14/3.15
only). That, or pass -Wno-deprecated-declarations for compiling
ui/gtk.c, but that seems very ugly to me.
Not planning to have OpenGL support for 3.14/3.15 I think is fine, but
we have to make sure that OpenGL support cannot be silently enabled by
configure and then break compilation of qemu.
Max