diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2015-05-29 14:24:35 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2015-05-29 14:24:35 +0100 |
commit | 2a90c454a1b90ace56ed908cd064f2fd483d1231 (patch) | |
tree | 3173af838a8d232c3b38e16e7453d68e558883fd /include | |
parent | 9441aa282bc3213ef0530cab86f318b877bac25c (diff) | |
parent | 63c67b6d4462b6589b371d55e3740e9f0dba3281 (diff) |
Merge remote-tracking branch 'remotes/kraxel/tags/pull-gtk-20150529-1' into staging
gtk: add opengl rendering support.
small bugfixes for gtk and opengl ui code.
# gpg: Signature made Fri May 29 10:44:54 2015 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg: aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
* remotes/kraxel/tags/pull-gtk-20150529-1:
gtk: Replace gdk_cursor_new()
gtk: add opengl support, using egl
ui: add egl-helpers
ui: shader.h protect against double inclusion
ui: use libexpoxy
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/ui/console.h | 5 | ||||
-rw-r--r-- | include/ui/egl-helpers.h | 16 | ||||
-rw-r--r-- | include/ui/gtk.h | 23 | ||||
-rw-r--r-- | include/ui/shader.h | 10 |
4 files changed, 47 insertions, 7 deletions
diff --git a/include/ui/console.h b/include/ui/console.h index e8b3a9ea8d..6f7550ef9c 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -10,8 +10,7 @@ #include "qapi/error.h" #ifdef CONFIG_OPENGL -# include <GLES2/gl2.h> -# include <GLES2/gl2ext.h> +# include <epoxy/gl.h> #endif /* keyboard/mouse support */ @@ -394,7 +393,7 @@ void curses_display_init(DisplayState *ds, int full_screen); int index_from_key(const char *key); /* gtk.c */ -void early_gtk_display_init(void); +void early_gtk_display_init(int opengl); void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover); #endif diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h new file mode 100644 index 0000000000..5ad5dc3081 --- /dev/null +++ b/include/ui/egl-helpers.h @@ -0,0 +1,16 @@ +#ifndef EGL_HELPERS_H +#define EGL_HELPERS_H + +#include <epoxy/gl.h> +#include <epoxy/egl.h> + +extern EGLDisplay *qemu_egl_display; +extern EGLConfig qemu_egl_config; + +EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, Window win); + +int qemu_egl_init_dpy(EGLNativeDisplayType dpy, bool gles, bool debug); +EGLContext qemu_egl_init_ctx(void); +bool qemu_egl_has_ext(const char *haystack, const char *needle); + +#endif /* EGL_HELPERS_H */ diff --git a/include/ui/gtk.h b/include/ui/gtk.h index b750845ab5..ee6dffd306 100644 --- a/include/ui/gtk.h +++ b/include/ui/gtk.h @@ -22,6 +22,10 @@ #include <X11/XKBlib.h> #endif +#if defined(CONFIG_OPENGL) +#include "ui/egl-helpers.h" +#endif + /* Compatibility define to let us build on both Gtk2 and Gtk3 */ #if GTK_CHECK_VERSION(3, 0, 0) static inline void gdk_drawable_get_size(GdkWindow *w, gint *ww, gint *wh) @@ -41,6 +45,12 @@ typedef struct VirtualGfxConsole { cairo_surface_t *surface; double scale_x; double scale_y; +#if defined(CONFIG_OPENGL) + ConsoleGLState *gls; + EGLContext ectx; + EGLSurface esurface; + int glupdates; +#endif } VirtualGfxConsole; #if defined(CONFIG_VTE) @@ -73,4 +83,17 @@ typedef struct VirtualConsole { }; } VirtualConsole; +/* ui/gtk.c */ +void gd_update_windowsize(VirtualConsole *vc); + +/* ui/gtk-egl.c */ +void gd_egl_init(VirtualConsole *vc); +void gd_egl_draw(VirtualConsole *vc); +void gd_egl_update(DisplayChangeListener *dcl, + int x, int y, int w, int h); +void gd_egl_refresh(DisplayChangeListener *dcl); +void gd_egl_switch(DisplayChangeListener *dcl, + DisplaySurface *surface); +void gtk_egl_init(void); + #endif /* UI_GTK_H */ diff --git a/include/ui/shader.h b/include/ui/shader.h index 1ff926c9e1..8509596ac0 100644 --- a/include/ui/shader.h +++ b/include/ui/shader.h @@ -1,7 +1,7 @@ -#ifdef CONFIG_OPENGL -# include <GLES2/gl2.h> -# include <GLES2/gl2ext.h> -#endif +#ifndef QEMU_SHADER_H +#define QEMU_SHADER_H + +#include <epoxy/gl.h> void qemu_gl_run_texture_blit(GLint texture_blit_prog); @@ -9,3 +9,5 @@ GLuint qemu_gl_create_compile_shader(GLenum type, const GLchar *src); GLuint qemu_gl_create_link_program(GLuint vert, GLuint frag); GLuint qemu_gl_create_compile_link_program(const GLchar *vert_src, const GLchar *frag_src); + +#endif /* QEMU_SHADER_H */ |