diff --git a/clutter/clutter-paint-volume.c b/clutter/clutter-paint-volume.c index 8435da51e..969bef739 100644 --- a/clutter/clutter-paint-volume.c +++ b/clutter/clutter-paint-volume.c @@ -908,3 +908,18 @@ clutter_paint_volume_set_from_allocation (ClutterPaintVolume *pv, return _clutter_actor_set_default_paint_volume (actor, G_TYPE_INVALID, pv); } + +/* Currently paint volumes are defined relative to a given actor, but + * in some cases it is desireable to be able to change the actor that + * a volume relates too (For instance for ClutterClone actors where we + * need to masquarade the source actors volume as the volume for the + * clone). */ +void +_clutter_paint_volume_set_reference_actor (ClutterPaintVolume *pv, + ClutterActor *actor) +{ + g_return_if_fail (pv != NULL); + + g_object_unref (pv->actor); + pv->actor = g_object_ref (actor); +} diff --git a/clutter/clutter-private.h b/clutter/clutter-private.h index 1529bb1bf..1186b848b 100644 --- a/clutter/clutter-private.h +++ b/clutter/clutter-private.h @@ -505,24 +505,26 @@ gpointer _clutter_event_get_platform_data (const ClutterEvent *event); #endif -void _clutter_paint_volume_init_static (ClutterActor *actor, - ClutterPaintVolume *pv); -ClutterPaintVolume *_clutter_paint_volume_new (ClutterActor *actor); -void _clutter_paint_volume_copy_static (const ClutterPaintVolume *src_pv, - ClutterPaintVolume *dst_pv); -void _clutter_paint_volume_set_from_volume (ClutterPaintVolume *pv, - const ClutterPaintVolume *src); +void _clutter_paint_volume_init_static (ClutterActor *actor, + ClutterPaintVolume *pv); +ClutterPaintVolume *_clutter_paint_volume_new (ClutterActor *actor); +void _clutter_paint_volume_copy_static (const ClutterPaintVolume *src_pv, + ClutterPaintVolume *dst_pv); +void _clutter_paint_volume_set_from_volume (ClutterPaintVolume *pv, + const ClutterPaintVolume *src); -void _clutter_paint_volume_complete (ClutterPaintVolume *pv); -void _clutter_paint_volume_transform (ClutterPaintVolume *pv, - const CoglMatrix *matrix); -void _clutter_paint_volume_project (ClutterPaintVolume *pv, - const CoglMatrix *modelview, - const CoglMatrix *projection, - const int *viewport); -void _clutter_paint_volume_get_bounding_box (ClutterPaintVolume *pv, - ClutterActorBox *box); -void _clutter_paint_volume_axis_align (ClutterPaintVolume *pv); +void _clutter_paint_volume_complete (ClutterPaintVolume *pv); +void _clutter_paint_volume_transform (ClutterPaintVolume *pv, + const CoglMatrix *matrix); +void _clutter_paint_volume_project (ClutterPaintVolume *pv, + const CoglMatrix *modelview, + const CoglMatrix *projection, + const int *viewport); +void _clutter_paint_volume_get_bounding_box (ClutterPaintVolume *pv, + ClutterActorBox *box); +void _clutter_paint_volume_axis_align (ClutterPaintVolume *pv); +void _clutter_paint_volume_set_reference_actor (ClutterPaintVolume *pv, + ClutterActor *actor);