mirror of
https://github.com/brl/mutter.git
synced 2024-11-22 16:10:41 -05:00
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:
parent
c687ece72d
commit
627a1b1977
@ -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]);
|
||||
}
|
||||
|
@ -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]);
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user