From 362e26b3e2568322ee8d58b13e493e8771ed83ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Mon, 24 Jul 2017 15:54:29 +0800 Subject: [PATCH] renderer-native: Add MetaEgl getter from renderer https://bugzilla.gnome.org/show_bug.cgi?id=785381 --- src/backends/native/meta-renderer-native.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c index f1d7b6923..521da033c 100644 --- a/src/backends/native/meta-renderer-native.c +++ b/src/backends/native/meta-renderer-native.c @@ -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;