diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2017-07-24 16:19:55 +0800 |
---|---|---|
committer | Jonas Ådahl <jadahl@gmail.com> | 2017-10-05 18:17:25 -0400 |
commit | b0e42d3f6e095feee5e2e62cb04f2370fb7bfca8 (patch) | |
tree | ec177c8280541b02e4baefcef653d4f0adf3aa8c /src/backends/meta-egl.c | |
parent | 18eb66de061d9b59484a5a4d43c00e9a21c0104e (diff) | |
download | mutter-b0e42d3f6e095feee5e2e62cb04f2370fb7bfca8.tar.gz |
renderer-native: Always use MetaEgl when interacting with EGL
Partly for consistency, partly for error handling functionality.
https://bugzilla.gnome.org/show_bug.cgi?id=785381
Diffstat (limited to 'src/backends/meta-egl.c')
-rw-r--r-- | src/backends/meta-egl.c | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/backends/meta-egl.c b/src/backends/meta-egl.c index 3031e9baa..3e3a56734 100644 --- a/src/backends/meta-egl.c +++ b/src/backends/meta-egl.c @@ -291,6 +291,27 @@ meta_egl_choose_config (MetaEgl *egl, } EGLSurface +meta_egl_create_window_surface (MetaEgl *egl, + EGLDisplay display, + EGLConfig config, + EGLNativeWindowType native_window_type, + const EGLint *attrib_list, + GError **error) +{ + EGLSurface surface; + + surface = eglCreateWindowSurface (display, config, + native_window_type, attrib_list); + if (surface == EGL_NO_SURFACE) + { + set_egl_error (error); + return EGL_NO_SURFACE; + } + + return surface; +} + +EGLSurface meta_egl_create_pbuffer_surface (MetaEgl *egl, EGLDisplay display, EGLConfig config, @@ -309,6 +330,21 @@ meta_egl_create_pbuffer_surface (MetaEgl *egl, return surface; } +gboolean +meta_egl_destroy_surface (MetaEgl *egl, + EGLDisplay display, + EGLSurface surface, + GError **error) +{ + if (!eglDestroySurface (display, surface)) + { + set_egl_error (error); + return FALSE; + } + + return TRUE; +} + static gboolean is_egl_proc_valid_real (void *proc, const char *proc_name, @@ -353,6 +389,20 @@ meta_egl_get_platform_display (MetaEgl *egl, return display; } +gboolean +meta_egl_terminate (MetaEgl *egl, + EGLDisplay display, + GError **error) +{ + if (!eglTerminate (display)) + { + set_egl_error (error); + return FALSE; + } + + return TRUE; +} + EGLImageKHR meta_egl_create_image (MetaEgl *egl, EGLDisplay display, |