paint_volume: Adds _clutter_paint_volume_set_from_volume

This adds a way to initialize a paint volume from another source paint
volume. This lets us for instance pass the contents of one paint volume
back through the out param of a get_paint_volume implementation.
This commit is contained in:
Robert Bragg 2010-09-09 17:53:29 +01:00
parent bfacca3011
commit 2d895816be
2 changed files with 15 additions and 0 deletions

View File

@ -150,6 +150,18 @@ clutter_paint_volume_copy (const ClutterPaintVolume *pv)
return copy;
}
void
_clutter_paint_volume_set_from_volume (ClutterPaintVolume *pv,
const ClutterPaintVolume *src)
{
if (src->actor != pv->actor)
{
g_object_unref (pv->actor);
g_object_ref (src->actor);
}
memcpy (pv, src, sizeof (ClutterPaintVolume));
}
/**
* clutter_paint_volume_free:
* @pv: a #ClutterPaintVolume

View File

@ -510,6 +510,9 @@ void _clutter_paint_volume_init_static (ClutterActor *actor,
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);