renderer-native: Add MetaEgl getter from renderer

https://bugzilla.gnome.org/show_bug.cgi?id=785381
This commit is contained in:
Jonas Ådahl 2017-07-24 15:54:29 +08:00
parent 5c53284bde
commit 362e26b3e2

View File

@ -228,6 +228,16 @@ meta_create_renderer_native_gpu_data (MetaGpuKms *gpu_kms)
return g_new0 (MetaRendererNativeGpuData, 1);
}
static MetaEgl *
meta_renderer_native_get_egl (MetaRendererNative *renderer_native)
{
MetaMonitorManager *monitor_manager =
META_MONITOR_MANAGER (renderer_native->monitor_manager_kms);
MetaBackend *backend = meta_monitor_manager_get_backend (monitor_manager);
return meta_backend_get_egl (backend);
}
static void
meta_renderer_native_disconnect (CoglRenderer *cogl_renderer)
{
@ -1969,8 +1979,7 @@ find_egl_device (MetaRendererNative *renderer_native,
MetaGpuKms *gpu_kms,
GError **error)
{
MetaBackend *backend = meta_get_backend ();
MetaEgl *egl = meta_backend_get_egl (backend);
MetaEgl *egl = meta_renderer_native_get_egl (renderer_native);
char **missing_extensions;
EGLint num_devices;
EGLDeviceEXT *devices;
@ -2046,8 +2055,7 @@ get_egl_device_display (MetaRendererNative *renderer_native,
EGLDeviceEXT egl_device,
GError **error)
{
MetaBackend *backend = meta_get_backend ();
MetaEgl *egl = meta_backend_get_egl (backend);
MetaEgl *egl = meta_renderer_native_get_egl (renderer_native);
int kms_fd = meta_gpu_kms_get_fd (gpu_kms);
EGLint platform_attribs[] = {
EGL_DRM_MASTER_FD_EXT, kms_fd,
@ -2065,8 +2073,7 @@ create_renderer_gpu_data_egl_device (MetaRendererNative *renderer_native,
MetaGpuKms *gpu_kms,
GError **error)
{
MetaBackend *backend = meta_get_backend ();
MetaEgl *egl = meta_backend_get_egl (backend);
MetaEgl *egl = meta_renderer_native_get_egl (renderer_native);
char **missing_extensions;
EGLDeviceEXT egl_device;
EGLDisplay egl_display;