mirror of
https://github.com/brl/mutter.git
synced 2025-02-19 22:54:08 +00:00
clutter/actor: Introduce notify_transform_invalid
This allows clients to maybe avoid triggering a redraw if they don't know beforehand if the transform would actually change. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2726>
This commit is contained in:
parent
875922fbe3
commit
ddc5de610b
@ -19184,3 +19184,36 @@ void clutter_actor_set_implicitly_grabbed (ClutterActor *self,
|
|||||||
|
|
||||||
g_assert (priv->implicitly_grabbed_count >= 0);
|
g_assert (priv->implicitly_grabbed_count >= 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* clutter_actor_notify_transform_invalid:
|
||||||
|
* @self: A #ClutterActor
|
||||||
|
*
|
||||||
|
* Invalidate the cached transformation matrix of @self and queue a redraw
|
||||||
|
* if the transformation matrix has changed.
|
||||||
|
* This is needed for implementations overriding the apply_transform()
|
||||||
|
* vfunc and has to be called if the matrix returned by apply_transform()
|
||||||
|
* would change due to state outside of the object itself.
|
||||||
|
*/
|
||||||
|
void
|
||||||
|
clutter_actor_notify_transform_invalid (ClutterActor *self)
|
||||||
|
{
|
||||||
|
ClutterActorPrivate *priv = self->priv;
|
||||||
|
graphene_matrix_t old_transform;
|
||||||
|
|
||||||
|
if (!priv->transform_valid)
|
||||||
|
{
|
||||||
|
clutter_actor_queue_redraw (self);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
graphene_matrix_init_from_matrix (&old_transform, &priv->transform);
|
||||||
|
|
||||||
|
transform_changed (self);
|
||||||
|
ensure_valid_actor_transform (self);
|
||||||
|
|
||||||
|
g_assert (priv->transform_valid);
|
||||||
|
|
||||||
|
if (!graphene_matrix_equal (&old_transform, &priv->transform))
|
||||||
|
clutter_actor_queue_redraw (self);
|
||||||
|
}
|
||||||
|
@ -132,6 +132,9 @@ void clutter_get_debug_flags (ClutterDebugFlag *debug_flags,
|
|||||||
ClutterDrawDebugFlag *draw_flags,
|
ClutterDrawDebugFlag *draw_flags,
|
||||||
ClutterPickDebugFlag *pick_flags);
|
ClutterPickDebugFlag *pick_flags);
|
||||||
|
|
||||||
|
CLUTTER_EXPORT
|
||||||
|
void clutter_actor_notify_transform_invalid (ClutterActor *self);
|
||||||
|
|
||||||
#undef __CLUTTER_H_INSIDE__
|
#undef __CLUTTER_H_INSIDE__
|
||||||
|
|
||||||
#endif /* __CLUTTER_MUTTER_H__ */
|
#endif /* __CLUTTER_MUTTER_H__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user