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
This commit is contained in:
Jonas Ådahl 2020-05-29 19:18:47 +02:00
parent 551101c65c
commit 468bf81307
6 changed files with 11 additions and 19 deletions

View File

@ -58,11 +58,6 @@ meta_surface_actor_wayland_process_damage (MetaSurfaceActor *actor,
meta_surface_actor_update_area (actor, x, y, width, height); meta_surface_actor_update_area (actor, x, y, width, height);
} }
static void
meta_surface_actor_wayland_pre_paint (MetaSurfaceActor *actor)
{
}
static gboolean static gboolean
meta_surface_actor_wayland_is_opaque (MetaSurfaceActor *actor) 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); GObjectClass *object_class = G_OBJECT_CLASS (klass);
surface_actor_class->process_damage = meta_surface_actor_wayland_process_damage; 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; surface_actor_class->is_opaque = meta_surface_actor_wayland_is_opaque;
object_class->dispose = meta_surface_actor_wayland_dispose; object_class->dispose = meta_surface_actor_wayland_dispose;

View File

@ -220,10 +220,9 @@ meta_surface_actor_x11_process_damage (MetaSurfaceActor *actor,
meta_surface_actor_update_area (actor, x, y, width, height); meta_surface_actor_update_area (actor, x, y, width, height);
} }
static void void
meta_surface_actor_x11_pre_paint (MetaSurfaceActor *actor) meta_surface_actor_x11_handle_updates (MetaSurfaceActorX11 *self)
{ {
MetaSurfaceActorX11 *self = META_SURFACE_ACTOR_X11 (actor);
MetaDisplay *display = self->display; MetaDisplay *display = self->display;
Display *xdisplay = meta_x11_display_get_xdisplay (display->x11_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; object_class->dispose = meta_surface_actor_x11_dispose;
surface_actor_class->process_damage = meta_surface_actor_x11_process_damage; 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; surface_actor_class->is_opaque = meta_surface_actor_x11_is_opaque;
} }

View File

@ -55,6 +55,8 @@ gboolean meta_surface_actor_x11_is_unredirected (MetaSurfaceActorX11 *self);
gboolean meta_surface_actor_x11_is_visible (MetaSurfaceActorX11 *self); gboolean meta_surface_actor_x11_is_visible (MetaSurfaceActorX11 *self);
void meta_surface_actor_x11_handle_updates (MetaSurfaceActorX11 *self);
G_END_DECLS G_END_DECLS
#endif /* __META_SURFACE_ACTOR_X11_H__ */ #endif /* __META_SURFACE_ACTOR_X11_H__ */

View File

@ -555,12 +555,6 @@ meta_surface_actor_process_damage (MetaSurfaceActor *self,
META_SURFACE_ACTOR_GET_CLASS (self)->process_damage (self, x, y, width, height); 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 void
meta_surface_actor_set_frozen (MetaSurfaceActor *self, meta_surface_actor_set_frozen (MetaSurfaceActor *self,
gboolean frozen) gboolean frozen)

View File

@ -24,7 +24,6 @@ struct _MetaSurfaceActorClass
void (* process_damage) (MetaSurfaceActor *actor, void (* process_damage) (MetaSurfaceActor *actor,
int x, int y, int width, int height); int x, int y, int width, int height);
void (* pre_paint) (MetaSurfaceActor *actor);
gboolean (* is_opaque) (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, void meta_surface_actor_process_damage (MetaSurfaceActor *actor,
int x, int y, int width, int height); 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_opaque (MetaSurfaceActor *actor);
gboolean meta_surface_actor_is_frozen (MetaSurfaceActor *actor); gboolean meta_surface_actor_is_frozen (MetaSurfaceActor *actor);

View File

@ -1209,7 +1209,12 @@ handle_updates (MetaWindowActorX11 *actor_x11)
return; 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) || if (!META_IS_SURFACE_ACTOR_X11 (surface) ||
!meta_surface_actor_x11_is_visible (META_SURFACE_ACTOR_X11 (surface))) !meta_surface_actor_x11_is_visible (META_SURFACE_ACTOR_X11 (surface)))