[mutter/gnome-3-36] renderer: Change 'set_legacy_view()' to 'add_view()'



commit 6e6183ec085152d5ff581e63763a23e577d1f401
Author: Jonas Ådahl <jadahl gmail com>
Date:   Tue May 12 08:50:54 2020 +0200

    renderer: Change 'set_legacy_view()' to 'add_view()'
    
    "Legacy" is a misleading name, it's just how the native backend and the
    X11 backend behaves differently. Instead rename it to 'add_view()' and
    add the sanity check to the caller.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1251
    (cherry picked from commit 73a436362aa75333b1d7faa93bea21a916ec1fef)

 src/backends/meta-renderer.c                       | 8 +++-----
 src/backends/meta-renderer.h                       | 4 ++--
 src/backends/x11/nested/meta-renderer-x11-nested.c | 3 ++-
 3 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/src/backends/meta-renderer.c b/src/backends/meta-renderer.c
index 3846bde7d..983a570e1 100644
--- a/src/backends/meta-renderer.c
+++ b/src/backends/meta-renderer.c
@@ -160,14 +160,12 @@ meta_renderer_real_rebuild_views (MetaRenderer *renderer)
 }
 
 void
-meta_renderer_set_legacy_view (MetaRenderer     *renderer,
-                               MetaRendererView *legacy_view)
+meta_renderer_add_view (MetaRenderer     *renderer,
+                        MetaRendererView *view)
 {
   MetaRendererPrivate *priv = meta_renderer_get_instance_private (renderer);
 
-  g_assert (!priv->views);
-
-  priv->views = g_list_append (priv->views, legacy_view);
+  priv->views = g_list_append (priv->views, view);
 }
 
 /**
diff --git a/src/backends/meta-renderer.h b/src/backends/meta-renderer.h
index e6160922a..247d2c2aa 100644
--- a/src/backends/meta-renderer.h
+++ b/src/backends/meta-renderer.h
@@ -54,8 +54,8 @@ CoglRenderer * meta_renderer_create_cogl_renderer (MetaRenderer *renderer);
 
 void meta_renderer_rebuild_views (MetaRenderer *renderer);
 
-void meta_renderer_set_legacy_view (MetaRenderer     *renderer,
-                                    MetaRendererView *legacy_view);
+void meta_renderer_add_view (MetaRenderer     *renderer,
+                             MetaRendererView *view);
 
 META_EXPORT_TEST
 GList * meta_renderer_get_views (MetaRenderer *renderer);
diff --git a/src/backends/x11/nested/meta-renderer-x11-nested.c 
b/src/backends/x11/nested/meta-renderer-x11-nested.c
index 6c8b9d63f..0223fe87e 100644
--- a/src/backends/x11/nested/meta-renderer-x11-nested.c
+++ b/src/backends/x11/nested/meta-renderer-x11-nested.c
@@ -167,7 +167,8 @@ meta_renderer_x11_nested_ensure_legacy_view (MetaRendererX11Nested *renderer_x11
                               "framebuffer", COGL_FRAMEBUFFER (fake_onscreen),
                               NULL);
 
-  meta_renderer_set_legacy_view (renderer, legacy_view);
+  g_assert (!meta_renderer_get_views (renderer));
+  meta_renderer_add_view (renderer, legacy_view);
 }
 
 static MetaRendererView *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]