[mutter] surface-actor: Remove 'pre-paint' vfunc



commit 468bf8130775befc9d6845bf776a10868207b9f3
Author: Jonas Ã…dahl <jadahl gmail com>
Date:   Fri May 29 19:18:47 2020 +0200

    surface-actor: Remove 'pre-paint' vfunc
    
    The vfunc was not tied to "paint", but was used by MetaWindowActorX11
    as part of the "update" mechanisms. In order to make that more clear,
    special case it in MetaWindowActorX11 by type checking the surface
    actor, handling the case without MetaSurfacActor abstraction.
    
    https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1285

 src/compositor/meta-surface-actor-wayland.c | 6 ------
 src/compositor/meta-surface-actor-x11.c     | 6 ++----
 src/compositor/meta-surface-actor-x11.h     | 2 ++
 src/compositor/meta-surface-actor.c         | 6 ------
 src/compositor/meta-surface-actor.h         | 3 +--
 src/compositor/meta-window-actor-x11.c      | 7 ++++++-
 6 files changed, 11 insertions(+), 19 deletions(-)
---
diff --git a/src/compositor/meta-surface-actor-wayland.c b/src/compositor/meta-surface-actor-wayland.c
index ce50da1620..b8071067bd 100644
--- a/src/compositor/meta-surface-actor-wayland.c
+++ b/src/compositor/meta-surface-actor-wayland.c
@@ -58,11 +58,6 @@ meta_surface_actor_wayland_process_damage (MetaSurfaceActor *actor,
   meta_surface_actor_update_area (actor, x, y, width, height);
 }
 
-static void
-meta_surface_actor_wayland_pre_paint (MetaSurfaceActor *actor)
-{
-}
-
 static gboolean
 meta_surface_actor_wayland_is_opaque (MetaSurfaceActor *actor)
 {
@@ -113,7 +108,6 @@ meta_surface_actor_wayland_class_init (MetaSurfaceActorWaylandClass *klass)
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
   surface_actor_class->process_damage = meta_surface_actor_wayland_process_damage;
-  surface_actor_class->pre_paint = meta_surface_actor_wayland_pre_paint;
   surface_actor_class->is_opaque = meta_surface_actor_wayland_is_opaque;
 
   object_class->dispose = meta_surface_actor_wayland_dispose;
diff --git a/src/compositor/meta-surface-actor-x11.c b/src/compositor/meta-surface-actor-x11.c
index 3b1a250d94..d46e5ad496 100644
--- a/src/compositor/meta-surface-actor-x11.c
+++ b/src/compositor/meta-surface-actor-x11.c
@@ -220,10 +220,9 @@ meta_surface_actor_x11_process_damage (MetaSurfaceActor *actor,
   meta_surface_actor_update_area (actor, x, y, width, height);
 }
 
-static void
-meta_surface_actor_x11_pre_paint (MetaSurfaceActor *actor)
+void
+meta_surface_actor_x11_handle_updates (MetaSurfaceActorX11 *self)
 {
-  MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
   MetaDisplay *display = self->display;
   Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_display);
 
@@ -332,7 +331,6 @@ meta_surface_actor_x11_class_init (MetaSurfaceActorX11Class *klass)
   object_class->dispose = meta_surface_actor_x11_dispose;
 
   surface_actor_class->process_damage = meta_surface_actor_x11_process_damage;
-  surface_actor_class->pre_paint = meta_surface_actor_x11_pre_paint;
   surface_actor_class->is_opaque = meta_surface_actor_x11_is_opaque;
 }
 
diff --git a/src/compositor/meta-surface-actor-x11.h b/src/compositor/meta-surface-actor-x11.h
index 9fd703bfe0..0a8517236a 100644
--- a/src/compositor/meta-surface-actor-x11.h
+++ b/src/compositor/meta-surface-actor-x11.h
@@ -55,6 +55,8 @@ gboolean meta_surface_actor_x11_is_unredirected (MetaSurfaceActorX11 *self);
 
 gboolean meta_surface_actor_x11_is_visible (MetaSurfaceActorX11 *self);
 
+void meta_surface_actor_x11_handle_updates (MetaSurfaceActorX11 *self);
+
 G_END_DECLS
 
 #endif /* __META_SURFACE_ACTOR_X11_H__ */
diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c
index 2f3934a400..884a7a2b34 100644
--- a/src/compositor/meta-surface-actor.c
+++ b/src/compositor/meta-surface-actor.c
@@ -555,12 +555,6 @@ meta_surface_actor_process_damage (MetaSurfaceActor *self,
   META_SURFACE_ACTOR_GET_CLASS (self)->process_damage (self, x, y, width, height);
 }
 
-void
-meta_surface_actor_pre_paint (MetaSurfaceActor *self)
-{
-  META_SURFACE_ACTOR_GET_CLASS (self)->pre_paint (self);
-}
-
 void
 meta_surface_actor_set_frozen (MetaSurfaceActor *self,
                                gboolean          frozen)
diff --git a/src/compositor/meta-surface-actor.h b/src/compositor/meta-surface-actor.h
index d8b7365b29..fb3764c0f9 100644
--- a/src/compositor/meta-surface-actor.h
+++ b/src/compositor/meta-surface-actor.h
@@ -24,7 +24,6 @@ struct _MetaSurfaceActorClass
 
   void     (* process_damage)    (MetaSurfaceActor *actor,
                                   int x, int y, int width, int height);
-  void     (* pre_paint)         (MetaSurfaceActor *actor);
   gboolean (* is_opaque)         (MetaSurfaceActor *actor);
 };
 
@@ -49,7 +48,7 @@ cairo_region_t * meta_surface_actor_get_opaque_region (MetaSurfaceActor *self);
 
 void meta_surface_actor_process_damage (MetaSurfaceActor *actor,
                                         int x, int y, int width, int height);
-void meta_surface_actor_pre_paint (MetaSurfaceActor *actor);
+
 gboolean meta_surface_actor_is_opaque (MetaSurfaceActor *actor);
 
 gboolean meta_surface_actor_is_frozen (MetaSurfaceActor *actor);
diff --git a/src/compositor/meta-window-actor-x11.c b/src/compositor/meta-window-actor-x11.c
index c8bc3784d0..c3067be027 100644
--- a/src/compositor/meta-window-actor-x11.c
+++ b/src/compositor/meta-window-actor-x11.c
@@ -1209,7 +1209,12 @@ handle_updates (MetaWindowActorX11 *actor_x11)
       return;
     }
 
-  meta_surface_actor_pre_paint (surface);
+  if (META_IS_SURFACE_ACTOR_X11 (surface))
+    {
+      MetaSurfaceActorX11 *surface_x11 = META_SURFACE_ACTOR_X11 (surface);
+
+      meta_surface_actor_x11_handle_updates (surface_x11);
+    }
 
   if (!META_IS_SURFACE_ACTOR_X11 (surface) ||
       !meta_surface_actor_x11_is_visible (META_SURFACE_ACTOR_X11 (surface)))


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