[metacity] compositor: move meta_surface_pre_paint to pre_paint vfunc



commit 12f94ba61440787c39f424e69dc75428f2bde7d4
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Oct 20 14:52:25 2019 +0300

    compositor: move meta_surface_pre_paint to pre_paint vfunc

 src/compositor/meta-compositor-none.c    |  6 ------
 src/compositor/meta-compositor-vulkan.c  |  1 +
 src/compositor/meta-compositor-xrender.c |  2 ++
 src/compositor/meta-compositor.c         | 22 ++++++++++++++++------
 4 files changed, 19 insertions(+), 12 deletions(-)
---
diff --git a/src/compositor/meta-compositor-none.c b/src/compositor/meta-compositor-none.c
index 0665d4a5..e873c1cc 100644
--- a/src/compositor/meta-compositor-none.c
+++ b/src/compositor/meta-compositor-none.c
@@ -77,11 +77,6 @@ meta_compositor_none_sync_window_geometry (MetaCompositor *compositor,
 {
 }
 
-static void
-meta_compositor_none_pre_paint (MetaCompositor *compositor)
-{
-}
-
 static void
 meta_compositor_none_redraw (MetaCompositor *compositor,
                              XserverRegion   all_damage)
@@ -103,7 +98,6 @@ meta_compositor_none_class_init (MetaCompositorNoneClass *none_class)
   compositor_class->process_event = meta_compositor_none_process_event;
   compositor_class->sync_screen_size = meta_compositor_none_sync_screen_size;
   compositor_class->sync_window_geometry = meta_compositor_none_sync_window_geometry;
-  compositor_class->pre_paint = meta_compositor_none_pre_paint;
   compositor_class->redraw = meta_compositor_none_redraw;
 }
 
diff --git a/src/compositor/meta-compositor-vulkan.c b/src/compositor/meta-compositor-vulkan.c
index 8c7bea35..8a91ad6b 100644
--- a/src/compositor/meta-compositor-vulkan.c
+++ b/src/compositor/meta-compositor-vulkan.c
@@ -1315,6 +1315,7 @@ meta_compositor_vulkan_sync_window_geometry (MetaCompositor *compositor,
 static void
 meta_compositor_vulkan_pre_paint (MetaCompositor *compositor)
 {
+  META_COMPOSITOR_CLASS (meta_compositor_vulkan_parent_class)->pre_paint (compositor);
 }
 
 static void
diff --git a/src/compositor/meta-compositor-xrender.c b/src/compositor/meta-compositor-xrender.c
index 1f9adee0..e9f13c5f 100644
--- a/src/compositor/meta-compositor-xrender.c
+++ b/src/compositor/meta-compositor-xrender.c
@@ -1617,6 +1617,8 @@ meta_compositor_xrender_pre_paint (MetaCompositor *compositor)
   if (xrender->root_buffer == None)
     xrender->root_buffer = create_root_buffer (xrender);
 
+  META_COMPOSITOR_CLASS (meta_compositor_xrender_parent_class)->pre_paint (compositor);
+
   stack = meta_compositor_get_stack (compositor);
 
   for (l = stack; l != NULL; l = l->next)
diff --git a/src/compositor/meta-compositor.c b/src/compositor/meta-compositor.c
index d51620aa..a9c2864e 100644
--- a/src/compositor/meta-compositor.c
+++ b/src/compositor/meta-compositor.c
@@ -169,18 +169,12 @@ redraw_idle_cb (gpointer user_data)
 {
   MetaCompositor *compositor;
   MetaCompositorPrivate *priv;
-  GHashTableIter iter;
-  MetaSurface *surface;
 
   compositor = META_COMPOSITOR (user_data);
   priv = meta_compositor_get_instance_private (compositor);
 
   META_COMPOSITOR_GET_CLASS (compositor)->pre_paint (compositor);
 
-  g_hash_table_iter_init (&iter, priv->surfaces);
-  while (g_hash_table_iter_next (&iter, NULL, (gpointer) &surface))
-    meta_surface_pre_paint (surface);
-
   if (priv->all_damage != None)
     {
       debug_damage_region (compositor, "paint_all", priv->all_damage);
@@ -343,6 +337,20 @@ meta_compositor_set_property (GObject      *object,
     }
 }
 
+static void
+meta_compositor_pre_paint (MetaCompositor *compositor)
+{
+  MetaCompositorPrivate *priv;
+  GHashTableIter iter;
+  MetaSurface *surface;
+
+  priv = meta_compositor_get_instance_private (compositor);
+
+  g_hash_table_iter_init (&iter, priv->surfaces);
+  while (g_hash_table_iter_next (&iter, NULL, (gpointer) &surface))
+    meta_surface_pre_paint (surface);
+}
+
 static void
 install_properties (GObjectClass *object_class)
 {
@@ -371,6 +379,8 @@ meta_compositor_class_init (MetaCompositorClass *compositor_class)
   object_class->get_property = meta_compositor_get_property;
   object_class->set_property = meta_compositor_set_property;
 
+  compositor_class->pre_paint = meta_compositor_pre_paint;
+
   install_properties (object_class);
 }
 


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