[clutter] effects: Use effect_queue_repaint instead of actor_queue_redraw
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] effects: Use effect_queue_repaint instead of actor_queue_redraw
- Date: Mon, 28 Nov 2011 18:37:27 +0000 (UTC)
commit 627a1b19771b98864eb9e09a9537128a87dca05e
Author: Neil Roberts <neil linux intel com>
Date: Mon Nov 28 14:19:28 2011 +0000
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>
clutter/clutter-colorize-effect.c | 10 +---------
clutter/clutter-desaturate-effect.c | 10 +---------
clutter/clutter-shader-effect.c | 2 +-
3 files changed, 3 insertions(+), 19 deletions(-)
---
diff --git a/clutter/clutter-colorize-effect.c b/clutter/clutter-colorize-effect.c
index f59a077..f1c8d32 100644
--- a/clutter/clutter-colorize-effect.c
+++ b/clutter/clutter-colorize-effect.c
@@ -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]);
}
diff --git a/clutter/clutter-desaturate-effect.c b/clutter/clutter-desaturate-effect.c
index 8f00630..7387ff5 100644
--- a/clutter/clutter-desaturate-effect.c
+++ b/clutter/clutter-desaturate-effect.c
@@ -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]);
}
diff --git a/clutter/clutter-shader-effect.c b/clutter/clutter-shader-effect.c
index 8c9e4b9..e53ee13 100644
--- a/clutter/clutter-shader-effect.c
+++ b/clutter/clutter-shader-effect.c
@@ -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));
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]