From 57a5f2296ae60a72cb64a506060664fb7362e628 Mon Sep 17 00:00:00 2001 From: Elliot Smith Date: Thu, 17 Mar 2011 15:45:57 +0000 Subject: [PATCH] docs: Remove checks for whether an effect is disabled pre_paint() and post_paint() implementations don't need to check whether an effect is disabled: Clutter will not apply an effect unless it is enabled. So remove code which checks whether the effect is enabled or disabled from the example applications and the documentation. --- doc/cookbook/effects.xml | 9 +-------- doc/cookbook/examples/cb-background-effect.c | 6 ------ doc/cookbook/examples/cb-border-effect.c | 6 ------ 3 files changed, 1 insertion(+), 20 deletions(-) diff --git a/doc/cookbook/effects.xml b/doc/cookbook/effects.xml index d6c02955d..79b5566e3 100644 --- a/doc/cookbook/effects.xml +++ b/doc/cookbook/effects.xml @@ -385,8 +385,7 @@ cb_background_effect_dispose (GObject *gobject) Now, the important part: implement pre_paint() and/or post_paint(), using Cogl to draw on the - material(s) set up for the effect. In these functions, you should also - check whether the effect is enabled before drawing. + material(s) set up for the effect. For the background effect, we implement pre_paint(), to draw a gray rectangle under the actor: @@ -405,12 +404,6 @@ cb_background_effect_pre_paint (ClutterEffect *self) gfloat height; CbBackgroundEffectPrivate *priv; - ClutterActorMeta *meta = CLUTTER_ACTOR_META (self); - - /* check that the effect is enabled before applying it */ - if (!clutter_actor_meta_get_enabled (meta)) - return TRUE; - priv = CB_BACKGROUND_EFFECT (self)->priv; /* get the associated actor's dimensions */ diff --git a/doc/cookbook/examples/cb-background-effect.c b/doc/cookbook/examples/cb-background-effect.c index 71b2ceee2..44a42b8f7 100644 --- a/doc/cookbook/examples/cb-background-effect.c +++ b/doc/cookbook/examples/cb-background-effect.c @@ -25,12 +25,6 @@ cb_background_effect_pre_paint (ClutterEffect *self) gfloat height; CbBackgroundEffectPrivate *priv; - ClutterActorMeta *meta = CLUTTER_ACTOR_META (self); - - /* check that the effect is enabled before applying it */ - if (!clutter_actor_meta_get_enabled (meta)) - return TRUE; - priv = CB_BACKGROUND_EFFECT (self)->priv; /* get the associated actor's dimensions */ diff --git a/doc/cookbook/examples/cb-border-effect.c b/doc/cookbook/examples/cb-border-effect.c index f7bb6b9a6..3de316d44 100644 --- a/doc/cookbook/examples/cb-border-effect.c +++ b/doc/cookbook/examples/cb-border-effect.c @@ -35,12 +35,6 @@ cb_border_effect_post_paint (ClutterEffect *self) gfloat height; CbBorderEffectPrivate *priv; - ClutterActorMeta *meta = CLUTTER_ACTOR_META (self); - - /* check that the effect is enabled before applying it */ - if (!clutter_actor_meta_get_enabled (meta)) - return; - priv = CB_BORDER_EFFECT (self)->priv; /* get the associated actor's dimensions */