From bd3762b7199bf8bc373fb245823e0bb8c730b913 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 4 Jul 2011 18:23:32 +0100 Subject: [PATCH] clutter-actor: Don't apply shaders during picking Commit 0ede622f5132 inadvertently made it so that shaders are applied during picking. This was making test-shader fail to respond to clicks. The commit also makes it so that culling is applied during picking. Presumably this is also unintentional because the commit message does not mention it. However I think it may make sense to do culling during picking so it might as well stay that way. https://bugzilla.gnome.org/show_bug.cgi?id=653959 --- clutter/clutter-actor.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index df1f59ec8..ce0b94d85 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -2813,6 +2813,8 @@ clutter_actor_paint (ClutterActor *self) ClutterActorPrivate *priv; ClutterPickMode pick_mode; gboolean clip_set = FALSE; + gboolean shader_applied = FALSE; + CLUTTER_STATIC_COUNTER (actor_paint_counter, "Actor real-paint counter", "Increments each time any actor is painted", @@ -2940,8 +2942,12 @@ clutter_actor_paint (ClutterActor *self) if (priv->effects == NULL) { - if (actor_has_shader_data (self)) - clutter_actor_shader_pre_paint (self, FALSE); + if (pick_mode == CLUTTER_PICK_NONE && + actor_has_shader_data (self)) + { + clutter_actor_shader_pre_paint (self, FALSE); + shader_applied = TRUE; + } priv->next_effect_to_paint = NULL; } else @@ -2950,8 +2956,7 @@ clutter_actor_paint (ClutterActor *self) clutter_actor_continue_paint (self); - if (priv->effects == NULL && - actor_has_shader_data (self)) + if (shader_applied) clutter_actor_shader_post_paint (self); if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_VOLUMES &&