2015-01-06 14:40:00 +00:00
|
|
|
#ifndef EGL_HELPERS_H
|
|
|
|
#define EGL_HELPERS_H
|
|
|
|
|
|
|
|
#include <epoxy/gl.h>
|
|
|
|
#include <epoxy/egl.h>
|
2015-10-12 10:03:49 +00:00
|
|
|
#include <gbm.h>
|
2015-01-06 14:40:00 +00:00
|
|
|
|
|
|
|
extern EGLDisplay *qemu_egl_display;
|
|
|
|
extern EGLConfig qemu_egl_config;
|
2018-06-18 11:21:41 +00:00
|
|
|
extern DisplayGLMode qemu_egl_mode;
|
2015-01-06 14:40:00 +00:00
|
|
|
|
2017-06-14 08:41:46 +00:00
|
|
|
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);
|
2017-09-27 11:50:31 +00:00
|
|
|
void egl_fb_setup_for_tex(egl_fb *fb, int width, int height,
|
|
|
|
GLuint texture, bool delete);
|
|
|
|
void egl_fb_setup_new_tex(egl_fb *fb, int width, int height);
|
2017-06-14 08:41:46 +00:00
|
|
|
void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip);
|
|
|
|
void egl_fb_read(void *dst, egl_fb *src);
|
|
|
|
|
2017-10-10 13:54:52 +00:00
|
|
|
void egl_texture_blit(QemuGLShader *gls, egl_fb *dst, egl_fb *src, bool flip);
|
|
|
|
void egl_texture_blend(QemuGLShader *gls, egl_fb *dst, egl_fb *src, bool flip,
|
|
|
|
int x, int y);
|
|
|
|
|
2015-10-12 10:03:49 +00:00
|
|
|
#ifdef CONFIG_OPENGL_DMABUF
|
|
|
|
|
|
|
|
extern int qemu_egl_rn_fd;
|
|
|
|
extern struct gbm_device *qemu_egl_rn_gbm_dev;
|
|
|
|
extern EGLContext qemu_egl_rn_ctx;
|
|
|
|
|
2018-06-18 11:21:41 +00:00
|
|
|
int egl_rendernode_init(const char *rendernode, DisplayGLMode mode);
|
2015-10-12 10:03:49 +00:00
|
|
|
int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc);
|
|
|
|
|
2017-10-10 13:54:51 +00:00
|
|
|
void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf);
|
|
|
|
void egl_dmabuf_release_texture(QemuDmaBuf *dmabuf);
|
|
|
|
|
2015-10-12 10:03:49 +00:00
|
|
|
#endif
|
|
|
|
|
2015-01-06 14:40:00 +00:00
|
|
|
EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, Window win);
|
|
|
|
|
2018-06-18 11:21:41 +00:00
|
|
|
int qemu_egl_init_dpy_x11(EGLNativeDisplayType dpy, DisplayGLMode mode);
|
|
|
|
int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, DisplayGLMode mode);
|
2015-01-06 14:40:00 +00:00
|
|
|
EGLContext qemu_egl_init_ctx(void);
|
|
|
|
|
|
|
|
#endif /* EGL_HELPERS_H */
|