effects: Use effect_queue_repaint instead of actor_queue_redraw

The builtin effects ClutterColorizeEffect, ClutterDesaturateEffect and
ClutterShaderEffect all have properties which only affect the
rendering of the final texture not the contents of it. When these
properties are updated we should queue a repaint of the effect not
the actor so that we don't waste time repainting the contents of the
offscreen buffer.

https://bugzilla.gnome.org/show_bug.cgi?id=665052

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
This commit is contained in:
Neil Roberts 2011-11-28 14:19:28 +00:00
parent c687ece72d
commit 627a1b1977
3 changed files with 3 additions and 19 deletions

View File

@ -54,9 +54,6 @@ struct _ClutterColorizeEffect
{
ClutterOffscreenEffect parent_instance;
/* a back pointer to our actor, so that we can query it */
ClutterActor *actor;
/* the tint of the colorization */
ClutterColor tint;
@ -119,10 +116,6 @@ clutter_colorize_effect_pre_paint (ClutterEffect *effect)
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
return FALSE;
self->actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (effect));
if (self->actor == NULL)
return FALSE;
if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
{
/* if we don't have support for GLSL shaders then we
@ -356,8 +349,7 @@ clutter_colorize_effect_set_tint (ClutterColorizeEffect *effect,
effect->tint = *tint;
if (effect->actor != NULL)
clutter_actor_queue_redraw (effect->actor);
clutter_effect_queue_repaint (CLUTTER_EFFECT (effect));
g_object_notify_by_pspec (G_OBJECT (effect), obj_props[PROP_TINT]);
}

View File

@ -58,9 +58,6 @@ struct _ClutterDesaturateEffect
{
ClutterOffscreenEffect parent_instance;
/* a back pointer to our actor, so that we can query it */
ClutterActor *actor;
/* the desaturation factor, also known as "strength" */
gdouble factor;
@ -127,10 +124,6 @@ clutter_desaturate_effect_pre_paint (ClutterEffect *effect)
if (!clutter_actor_meta_get_enabled (CLUTTER_ACTOR_META (effect)))
return FALSE;
self->actor = clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (effect));
if (self->actor == NULL)
return FALSE;
if (!clutter_feature_available (CLUTTER_FEATURE_SHADERS_GLSL))
{
/* if we don't have support for GLSL shaders then we
@ -364,8 +357,7 @@ clutter_desaturate_effect_set_factor (ClutterDesaturateEffect *effect,
{
effect->factor = factor;
if (effect->actor != NULL)
clutter_actor_queue_redraw (effect->actor);
clutter_effect_queue_repaint (CLUTTER_EFFECT (effect));
g_object_notify_by_pspec (G_OBJECT (effect), obj_props[PROP_FACTOR]);
}

View File

@ -634,7 +634,7 @@ clutter_shader_effect_add_uniform (ClutterShaderEffect *effect,
shader_uniform_update (uniform, value);
if (priv->actor != NULL && !CLUTTER_ACTOR_IN_PAINT (priv->actor))
clutter_actor_queue_redraw (priv->actor);
clutter_effect_queue_repaint (CLUTTER_EFFECT (effect));
}
/**