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))
- {
- CLUTTER_NOTE (PAINT, "Attempting realize via paint()");
- clutter_actor_realize(self);
-
- if (!CLUTTER_ACTOR_IS_REALIZED (self))
- {
- CLUTTER_NOTE (PAINT, "Attempt failed, aborting paint");
- return;
- }
- }
+ /* if we aren't paintable (not in a toplevel with all
+ * parents paintable) then do nothing.
+ */
+ if (!CLUTTER_ACTOR_IS_MAPPED (self))
+ return;
/* mark that we are in the paint process */
CLUTTER_SET_PRIVATE_FLAGS (self, CLUTTER_ACTOR_IN_PAINT);