summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2019-04-02 15:34:01 +0200
committerJonas Ådahl <jadahl@gmail.com>2019-04-02 13:49:59 +0000
commit808a75b231ae68cb746695b4617866a5cd5a8fe3 (patch)
tree72a72754c2e32a50e5aff3b56c6015da9423f655
parent88e4ff740964681a25ef07271f59db9d7bb44e3c (diff)
downloadmutter-808a75b231ae68cb746695b4617866a5cd5a8fe3.tar.gz
renderer-native: Add helper to get backend from renderer
https://gitlab.gnome.org/GNOME/mutter/merge_requests/506
-rw-r--r--src/backends/native/meta-renderer-native.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index 0f0992cbf..8258da37d 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -258,6 +258,15 @@ cogl_pixel_format_from_drm_format (uint32_t drm_format,
CoglPixelFormat *out_format,
CoglTextureComponents *out_components);
+static MetaBackend *
+backend_from_renderer_native (MetaRendererNative *renderer_native)
+{
+ MetaMonitorManager *monitor_manager =
+ META_MONITOR_MANAGER (renderer_native->monitor_manager_kms);
+
+ return meta_monitor_manager_get_backend (monitor_manager);
+}
+
static void
meta_renderer_native_gpu_data_free (MetaRendererNativeGpuData *renderer_gpu_data)
{
@@ -3363,9 +3372,7 @@ calculate_view_transform (MetaMonitorManager *monitor_manager,
static CoglContext *
cogl_context_from_renderer_native (MetaRendererNative *renderer_native)
{
- MetaMonitorManager *monitor_manager =
- META_MONITOR_MANAGER (renderer_native->monitor_manager_kms);
- MetaBackend *backend = meta_monitor_manager_get_backend (monitor_manager);
+ MetaBackend *backend = backend_from_renderer_native (renderer_native);
ClutterBackend *clutter_backend = meta_backend_get_clutter_backend (backend);
return clutter_backend_get_cogl_context (clutter_backend);