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
This commit is contained in:
Jonas Ådahl
2017-07-24 16:19:55 +08:00
parent 18eb66de06
commit b0e42d3f6e
3 changed files with 89 additions and 11 deletions

View File

@@ -290,6 +290,27 @@ meta_egl_choose_config (MetaEgl *egl,
return TRUE;
}
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,
@@ -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,