diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 5d9d95d6a..e59270259 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -1561,6 +1561,13 @@ clutter_actor_paint (ClutterActor *self) g_return_if_fail (CLUTTER_IS_ACTOR (self)); priv = self->priv; + context = clutter_context_get_default (); + + /* It's an important optimization that we consider painting of + * actors with 0 opacity to be a NOP... */ + if (G_LIKELY (context->pick_mode == CLUTTER_PICK_NONE) && + priv->opacity == 0) + return; if (!CLUTTER_ACTOR_IS_REALIZED (self)) { @@ -1603,7 +1610,6 @@ clutter_actor_paint (ClutterActor *self) clip_set = TRUE; } - context = clutter_context_get_default (); if (G_UNLIKELY (context->pick_mode != CLUTTER_PICK_NONE)) { ClutterColor col = { 0, }; @@ -3436,6 +3442,9 @@ clutter_actor_destroy (ClutterActor *self) * * This function will not do anything if @self is not visible, or * if the actor is inside an invisible part of the scenegraph. + * + * Also be aware that painting is a NOP for actors with an opacity of + * 0 */ void clutter_actor_queue_redraw (ClutterActor *self)