texture: Forward queue redraw/relayout for fbos

When clutter_texture_new_from_actor is use we need to track when the
source actor queues a redraw or a relayout so we can also queue a redraw
or relayout for the texture actor.
This commit is contained in:
Robert Bragg 2010-09-07 19:40:28 +01:00
parent 1ea7145efc
commit f8a6e36f1b

View File

@ -2426,6 +2426,21 @@ on_fbo_parent_change (ClutterActor *actor,
}
}
static void
fbo_source_queue_redraw_cb (ClutterActor *source,
ClutterActor *origin,
ClutterTexture *texture)
{
clutter_actor_queue_redraw (CLUTTER_ACTOR (texture));
}
static void
fbo_source_queue_relayout_cb (ClutterActor *source,
ClutterTexture *texture)
{
clutter_actor_queue_relayout (CLUTTER_ACTOR (texture));
}
/**
* clutter_texture_new_from_actor:
* @actor: A source #ClutterActor
@ -2589,6 +2604,11 @@ clutter_texture_new_from_actor (ClutterActor *actor)
G_CALLBACK(on_fbo_source_size_change),
texture);
g_signal_connect (actor, "queue-relayout",
G_CALLBACK (fbo_source_queue_relayout_cb), texture);
g_signal_connect (actor, "queue-redraw",
G_CALLBACK (fbo_source_queue_redraw_cb), texture);
/* And a warning if the source becomes a child of the texture */
g_signal_connect (actor,
"parent-set",
@ -2632,6 +2652,16 @@ texture_fbo_free_resources (ClutterTexture *texture)
G_CALLBACK(on_fbo_source_size_change),
texture);
g_signal_handlers_disconnect_by_func
(priv->fbo_source,
G_CALLBACK(fbo_source_queue_relayout_cb),
texture);
g_signal_handlers_disconnect_by_func
(priv->fbo_source,
G_CALLBACK(fbo_source_queue_redraw_cb),
texture);
g_object_unref (priv->fbo_source);
priv->fbo_source = NULL;