[clone] Allow painting hidden source actors

With the introduction of the map/unmap flags and the split of the
visible state from the mapped state we require that every part of
a scene graph branch is mapped in order to be painted. This breaks
the ability of a ClutterClone to paint an hidden source actor.

In order to fix this we need to introduce an override flag, similar
in spirit to the current modelview and paint opacity overrides that
Clone is already using.

The override flag, when set, will force a temporary map on a
Clone source (and its children).
This commit is contained in:
Emmanuele Bassi
2009-05-01 12:33:42 +01:00
parent 5d2d8297e2
commit 1a87e4e252
3 changed files with 112 additions and 30 deletions

View File

@ -122,6 +122,7 @@ clutter_clone_paint (ClutterActor *self)
ClutterClonePrivate *priv = clone->priv;
ClutterGeometry geom, clone_geom;
gfloat x_scale, y_scale;
gboolean was_unmapped = FALSE;
if (G_UNLIKELY (priv->clone_source == NULL))
return;
@ -155,8 +156,17 @@ clutter_clone_paint (ClutterActor *self)
_clutter_actor_set_opacity_parent (priv->clone_source, self);
_clutter_actor_set_enable_model_view_transform (priv->clone_source, FALSE);
if (!CLUTTER_ACTOR_IS_MAPPED (priv->clone_source))
{
_clutter_actor_set_enable_paint_unmapped (priv->clone_source, TRUE);
was_unmapped = TRUE;
}
clutter_actor_paint (priv->clone_source);
if (was_unmapped)
_clutter_actor_set_enable_paint_unmapped (priv->clone_source, FALSE);
_clutter_actor_set_enable_model_view_transform (priv->clone_source, TRUE);
_clutter_actor_set_opacity_parent (priv->clone_source, NULL);
}