]>
Commit | Line | Data |
---|---|---|
7ced9e9f GH |
1 | #ifndef EGL_HELPERS_H |
2 | #define EGL_HELPERS_H | |
3 | ||
4 | #include <epoxy/gl.h> | |
5 | #include <epoxy/egl.h> | |
1e316598 | 6 | #include <gbm.h> |
ec150c7e MA |
7 | #include "ui/console.h" |
8 | #include "ui/shader.h" | |
7ced9e9f GH |
9 | |
10 | extern EGLDisplay *qemu_egl_display; | |
11 | extern EGLConfig qemu_egl_config; | |
54d208ff | 12 | extern DisplayGLMode qemu_egl_mode; |
7ced9e9f | 13 | |
6fafc260 GH |
14 | typedef struct egl_fb { |
15 | int width; | |
16 | int height; | |
17 | GLuint texture; | |
18 | GLuint framebuffer; | |
19 | bool delete_texture; | |
20 | } egl_fb; | |
21 | ||
22 | void egl_fb_destroy(egl_fb *fb); | |
23 | void egl_fb_setup_default(egl_fb *fb, int width, int height); | |
74083f9c GH |
24 | void egl_fb_setup_for_tex(egl_fb *fb, int width, int height, |
25 | GLuint texture, bool delete); | |
26 | void egl_fb_setup_new_tex(egl_fb *fb, int width, int height); | |
6fafc260 | 27 | void egl_fb_blit(egl_fb *dst, egl_fb *src, bool flip); |
d2329237 | 28 | void egl_fb_read(DisplaySurface *dst, egl_fb *src); |
6fafc260 | 29 | |
0eb50c27 GH |
30 | void egl_texture_blit(QemuGLShader *gls, egl_fb *dst, egl_fb *src, bool flip); |
31 | void egl_texture_blend(QemuGLShader *gls, egl_fb *dst, egl_fb *src, bool flip, | |
051a0cde | 32 | int x, int y, double scale_x, double scale_y); |
0eb50c27 | 33 | |
1e316598 GH |
34 | #ifdef CONFIG_OPENGL_DMABUF |
35 | ||
36 | extern int qemu_egl_rn_fd; | |
37 | extern struct gbm_device *qemu_egl_rn_gbm_dev; | |
38 | extern EGLContext qemu_egl_rn_ctx; | |
39 | ||
54d208ff | 40 | int egl_rendernode_init(const char *rendernode, DisplayGLMode mode); |
5fc1fb62 GH |
41 | int egl_get_fd_for_texture(uint32_t tex_id, EGLint *stride, EGLint *fourcc, |
42 | EGLuint64KHR *modifier); | |
1e316598 | 43 | |
86c0522c GH |
44 | void egl_dmabuf_import_texture(QemuDmaBuf *dmabuf); |
45 | void egl_dmabuf_release_texture(QemuDmaBuf *dmabuf); | |
46 | ||
1e316598 GH |
47 | #endif |
48 | ||
fbd57c75 | 49 | EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, EGLNativeWindowType win); |
7ced9e9f | 50 | |
54d208ff GH |
51 | int qemu_egl_init_dpy_x11(EGLNativeDisplayType dpy, DisplayGLMode mode); |
52 | int qemu_egl_init_dpy_mesa(EGLNativeDisplayType dpy, DisplayGLMode mode); | |
7ced9e9f | 53 | EGLContext qemu_egl_init_ctx(void); |
7ced9e9f GH |
54 | |
55 | #endif /* EGL_HELPERS_H */ |