mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
surface-actor: Add meta_surface_actor_schedule_update()
This function allows scheduling a stage update in the context of a surface actor and emit the "update-scheduled" signal. This signal is similar to "repaint-scheduled", but can be used to be notified of updates that do not necessarily result in a repaint. With variable refresh rate, any update potentially affecting the frame pacing of a surface actor needs to be handled differently depending on whether that surface actor drives the refresh rate or not. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1154>
This commit is contained in:
parent
1318cd3faf
commit
627ab24721
@ -62,6 +62,7 @@ G_DEFINE_ABSTRACT_TYPE_WITH_CODE (MetaSurfaceActor, meta_surface_actor, CLUTTER_
|
||||
enum
|
||||
{
|
||||
REPAINT_SCHEDULED,
|
||||
UPDATE_SCHEDULED,
|
||||
SIZE_CHANGED,
|
||||
|
||||
LAST_SIGNAL,
|
||||
@ -293,6 +294,14 @@ meta_surface_actor_class_init (MetaSurfaceActorClass *klass)
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
signals[UPDATE_SCHEDULED] = g_signal_new ("update-scheduled",
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0,
|
||||
NULL, NULL, NULL,
|
||||
G_TYPE_NONE, 0);
|
||||
|
||||
|
||||
signals[SIZE_CHANGED] = g_signal_new ("size-changed",
|
||||
G_TYPE_FROM_CLASS (object_class),
|
||||
G_SIGNAL_RUN_LAST,
|
||||
@ -393,6 +402,17 @@ meta_surface_actor_get_texture (MetaSurfaceActor *self)
|
||||
return priv->texture;
|
||||
}
|
||||
|
||||
void
|
||||
meta_surface_actor_schedule_update (MetaSurfaceActor *self)
|
||||
{
|
||||
ClutterStage *stage =
|
||||
CLUTTER_STAGE (clutter_actor_get_stage (CLUTTER_ACTOR (self)));
|
||||
|
||||
clutter_stage_schedule_update (stage);
|
||||
|
||||
g_signal_emit (self, signals[UPDATE_SCHEDULED], 0);
|
||||
}
|
||||
|
||||
void
|
||||
meta_surface_actor_update_area (MetaSurfaceActor *self,
|
||||
int x,
|
||||
|
@ -49,6 +49,8 @@ void meta_surface_actor_set_opaque_region (MetaSurfaceActor *self,
|
||||
MtkRegion *region);
|
||||
MtkRegion * meta_surface_actor_get_opaque_region (MetaSurfaceActor *self);
|
||||
|
||||
void meta_surface_actor_schedule_update (MetaSurfaceActor *self);
|
||||
|
||||
void meta_surface_actor_process_damage (MetaSurfaceActor *actor,
|
||||
int x, int y, int width, int height);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user