summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2017-06-22 13:18:11 +0100
committerPeter Maydell <peter.maydell@linaro.org>2017-06-22 13:18:11 +0100
commit22a9e1fd63ebd7254c6618f144357def75a993cb (patch)
tree003d7a59d9bf8acf153910ac1dbe8e141c560a83 /include
parent84e3d0725b06bdf8c6985788caa7776d6b7353ce (diff)
parent95e92000c8b1e81fce6a7f54ef22656a94793096 (diff)
downloadqemu-22a9e1fd63ebd7254c6618f144357def75a993cb.tar.gz
Merge remote-tracking branch 'remotes/kraxel/tags/queue/ui-pull-request' into staging
# gpg: Signature made Wed 21 Jun 2017 14:23:31 BST # gpg: using RSA key 0x4CB6D8EED3E87138 # 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>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/queue/ui-pull-request: ui: Remove inclusion of "hw/qdev.h" console: remove do_safe_dpy_refresh gtk: use framebuffer helper functions. sdl2: use framebuffer helper functions. egl-headless: use framebuffer helper functions. egl-helpers: add helpers to handle opengl framebuffers Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/ui/egl-helpers.h15
-rw-r--r--include/ui/gtk.h4
-rw-r--r--include/ui/sdl2.h8
3 files changed, 23 insertions, 4 deletions
diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h
index c785d60e91..be8908737c 100644
--- a/include/ui/egl-helpers.h
+++ b/include/ui/egl-helpers.h
@@ -8,6 +8,21 @@
extern EGLDisplay *qemu_egl_display;
extern EGLConfig qemu_egl_config;
+typedef struct egl_fb {
+ int width;
+ int height;
+ GLuint texture;
+ GLuint framebuffer;
+ bool delete_texture;
+} egl_fb;
+
+void egl_fb_destroy(egl_fb *fb);
+void egl_fb_setup_default(egl_fb *fb, int width, int height);
+void egl_fb_create_for_tex(egl_fb *fb, int width, int height, GLuint texture);
+void egl_fb_create_new_tex(egl_fb *fb, int width, int height);
+void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip);
+void egl_fb_read(void *dst, egl_fb *src);
+
#ifdef CONFIG_OPENGL_DMABUF
extern int qemu_egl_rn_fd;
diff --git a/include/ui/gtk.h b/include/ui/gtk.h
index ca9a2268de..2f7b720358 100644
--- a/include/ui/gtk.h
+++ b/include/ui/gtk.h
@@ -52,8 +52,8 @@ typedef struct VirtualGfxConsole {
EGLSurface esurface;
int glupdates;
int x, y, w, h;
- GLuint tex_id;
- GLuint fbo_id;
+ egl_fb guest_fb;
+ egl_fb win_fb;
bool y0_top;
bool scanout_mode;
#endif
diff --git a/include/ui/sdl2.h b/include/ui/sdl2.h
index aaf226c2c0..454367ac84 100644
--- a/include/ui/sdl2.h
+++ b/include/ui/sdl2.h
@@ -7,6 +7,10 @@
#include <SDL.h>
#include <SDL_syswm.h>
+#ifdef CONFIG_OPENGL
+# include "ui/egl-helpers.h"
+#endif
+
struct sdl2_console {
DisplayChangeListener dcl;
DisplaySurface *surface;
@@ -23,8 +27,8 @@ struct sdl2_console {
SDL_GLContext winctx;
#ifdef CONFIG_OPENGL
ConsoleGLState *gls;
- GLuint tex_id;
- GLuint fbo_id;
+ egl_fb guest_fb;
+ egl_fb win_fb;
bool y0_top;
bool scanout_mode;
#endif