From 1a8d577168ef48a9fcef21415b44b2b8c2f9a26c Mon Sep 17 00:00:00 2001 From: Robert Bragg Date: Sat, 11 Sep 2010 02:39:23 +0100 Subject: [PATCH] clone: Implement get_paint_volume virtual To allow Clutter to queue clipped redraws when a clone actor changes we need to be able to report a paint volume for clone actors. This patch makes ClutterClones query the paint volume of their source actor and masquerade it as their own volume. --- clutter/clutter-clone.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/clutter/clutter-clone.c b/clutter/clutter-clone.c index 9f36f76eb..f84c9dec7 100644 --- a/clutter/clutter-clone.c +++ b/clutter/clutter-clone.c @@ -188,6 +188,24 @@ clutter_clone_paint (ClutterActor *self) _clutter_actor_set_opacity_parent (priv->clone_source, NULL); } +gboolean +clutter_clone_get_paint_volume (ClutterActor *self, + ClutterPaintVolume *volume) +{ + ClutterClonePrivate *priv = CLUTTER_CLONE (self)->priv; + const ClutterPaintVolume *source_volume; + + /* query the volume of the source actor and simply masquarade it as + * the clones volume... */ + source_volume = clutter_actor_get_paint_volume (priv->clone_source); + if (!source_volume) + return FALSE; + + _clutter_paint_volume_set_from_volume (volume, source_volume); + _clutter_paint_volume_set_reference_actor (volume, self); + return TRUE; +} + static void clutter_clone_allocate (ClutterActor *self, const ClutterActorBox *box, @@ -273,6 +291,7 @@ clutter_clone_class_init (ClutterCloneClass *klass) actor_class->apply_transform = clutter_clone_apply_transform; actor_class->paint = clutter_clone_paint; + actor_class->get_paint_volume = clutter_clone_get_paint_volume; actor_class->get_preferred_width = clutter_clone_get_preferred_width; actor_class->get_preferred_height = clutter_clone_get_preferred_height; actor_class->allocate = clutter_clone_allocate;