From 74a9b7106038b74690856fe45b658edbab5d6a8b Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 13 Jun 2011 15:58:46 +0100 Subject: [PATCH] effect: Rename RunFlags to PaintFlags Since run() was replaced and both paint() and pick() use the enumeration. https://bugzilla.gnome.org/show_bug.cgi?id=651700 --- clutter/clutter-actor.c | 6 +++--- clutter/clutter-effect-private.h | 16 +++++++------- clutter/clutter-effect.c | 18 ++++++++-------- clutter/clutter-effect.h | 34 ++++++++++++++---------------- clutter/clutter-offscreen-effect.c | 6 +++--- tests/conform/test-pick.c | 8 +++---- 6 files changed, 43 insertions(+), 45 deletions(-) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index fcea9b4db..81ba12b57 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -2991,7 +2991,7 @@ clutter_actor_continue_paint (ClutterActor *self) else { ClutterEffect *old_current_effect; - ClutterEffectRunFlags run_flags = 0; + ClutterEffectPaintFlags run_flags = 0; /* Cache the current effect so that we can put it back before returning */ @@ -3011,7 +3011,7 @@ clutter_actor_continue_paint (ClutterActor *self) (although it should work ok if it does) */ if (priv->effect_to_redraw == NULL || priv->current_effect != priv->effect_to_redraw) - run_flags |= CLUTTER_EFFECT_RUN_ACTOR_DIRTY; + run_flags |= CLUTTER_EFFECT_PAINT_ACTOR_DIRTY; } _clutter_effect_paint (priv->current_effect, run_flags); @@ -3021,7 +3021,7 @@ clutter_actor_continue_paint (ClutterActor *self) /* We can't determine when an actor has been modified since its last pick so lets just assume it has always been modified */ - run_flags |= CLUTTER_EFFECT_RUN_ACTOR_DIRTY; + run_flags |= CLUTTER_EFFECT_PAINT_ACTOR_DIRTY; _clutter_effect_pick (priv->current_effect, run_flags); } diff --git a/clutter/clutter-effect-private.h b/clutter/clutter-effect-private.h index 903455bf8..578b6a13a 100644 --- a/clutter/clutter-effect-private.h +++ b/clutter/clutter-effect-private.h @@ -5,14 +5,14 @@ G_BEGIN_DECLS -gboolean _clutter_effect_pre_paint (ClutterEffect *effect); -void _clutter_effect_post_paint (ClutterEffect *effect); -gboolean _clutter_effect_get_paint_volume (ClutterEffect *effect, - ClutterPaintVolume *volume); -void _clutter_effect_paint (ClutterEffect *effect, - ClutterEffectRunFlags flags); -void _clutter_effect_pick (ClutterEffect *effect, - ClutterEffectRunFlags flags); +gboolean _clutter_effect_pre_paint (ClutterEffect *effect); +void _clutter_effect_post_paint (ClutterEffect *effect); +gboolean _clutter_effect_get_paint_volume (ClutterEffect *effect, + ClutterPaintVolume *volume); +void _clutter_effect_paint (ClutterEffect *effect, + ClutterEffectPaintFlags flags); +void _clutter_effect_pick (ClutterEffect *effect, + ClutterEffectPaintFlags flags); G_END_DECLS diff --git a/clutter/clutter-effect.c b/clutter/clutter-effect.c index b32d1d422..576ea77de 100644 --- a/clutter/clutter-effect.c +++ b/clutter/clutter-effect.c @@ -44,7 +44,7 @@ * something like this: * * - * void effect_paint (ClutterEffect *effect, ClutterEffectRunFlags flags) + * void effect_paint (ClutterEffect *effect, ClutterEffectPaintFlags flags) * { * /* Set up initialisation of the paint such as binding a * CoglOffscreen or other operations */ @@ -228,8 +228,8 @@ clutter_effect_real_get_paint_volume (ClutterEffect *effect, } static void -clutter_effect_real_paint (ClutterEffect *effect, - ClutterEffectRunFlags flags) +clutter_effect_real_paint (ClutterEffect *effect, + ClutterEffectPaintFlags flags) { ClutterActorMeta *actor_meta = CLUTTER_ACTOR_META (effect); ClutterActor *actor; @@ -249,8 +249,8 @@ clutter_effect_real_paint (ClutterEffect *effect, } static void -clutter_effect_real_pick (ClutterEffect *effect, - ClutterEffectRunFlags flags) +clutter_effect_real_pick (ClutterEffect *effect, + ClutterEffectPaintFlags flags) { ClutterActorMeta *actor_meta = CLUTTER_ACTOR_META (effect); ClutterActor *actor; @@ -312,8 +312,8 @@ _clutter_effect_post_paint (ClutterEffect *effect) } void -_clutter_effect_paint (ClutterEffect *effect, - ClutterEffectRunFlags flags) +_clutter_effect_paint (ClutterEffect *effect, + ClutterEffectPaintFlags flags) { g_return_if_fail (CLUTTER_IS_EFFECT (effect)); @@ -321,8 +321,8 @@ _clutter_effect_paint (ClutterEffect *effect, } void -_clutter_effect_pick (ClutterEffect *effect, - ClutterEffectRunFlags flags) +_clutter_effect_pick (ClutterEffect *effect, + ClutterEffectPaintFlags flags) { g_return_if_fail (CLUTTER_IS_EFFECT (effect)); diff --git a/clutter/clutter-effect.h b/clutter/clutter-effect.h index 17e651e15..c5ba3458d 100644 --- a/clutter/clutter-effect.h +++ b/clutter/clutter-effect.h @@ -43,18 +43,17 @@ G_BEGIN_DECLS typedef struct _ClutterEffectClass ClutterEffectClass; /** - * ClutterEffectRunFlags: - * @CLUTTER_EFFECT_RUN_ACTOR_DIRTY: The actor or one of its children - * has queued a redraw before this paint. This implies that the effect - * should call clutter_actor_continue_paint() to chain to the next - * effect and can not cache any results from a previous paint. + * ClutterEffectPaintFlags: + * @CLUTTER_EFFECT_PAINT_ACTOR_DIRTY: The actor or one of its children + * has queued a redraw before this paint. This implies that the effect + * should call clutter_actor_continue_paint() to chain to the next + * effect and can not cache any results from a previous paint. * * Flags passed to the ‘paint’ or ‘pick’ method of #ClutterEffect. */ -typedef enum -{ - CLUTTER_EFFECT_RUN_ACTOR_DIRTY = (1 << 0) -} ClutterEffectRunFlags; +typedef enum { /*< prefix=CLUTTER_EFFECT_PAINT >*/ + CLUTTER_EFFECT_PAINT_ACTOR_DIRTY = (1 << 0) +} ClutterEffectPaintFlags; /** * ClutterEffect: @@ -87,17 +86,16 @@ struct _ClutterEffectClass ClutterActorMetaClass parent_class; /*< public >*/ - gboolean (* pre_paint) (ClutterEffect *effect); - void (* post_paint) (ClutterEffect *effect); + gboolean (* pre_paint) (ClutterEffect *effect); + void (* post_paint) (ClutterEffect *effect); - gboolean (* get_paint_volume) (ClutterEffect *effect, - ClutterPaintVolume *volume); + gboolean (* get_paint_volume) (ClutterEffect *effect, + ClutterPaintVolume *volume); - void (* paint) (ClutterEffect *effect, - ClutterEffectRunFlags flags); - - void (* pick) (ClutterEffect *effect, - ClutterEffectRunFlags flags); + void (* paint) (ClutterEffect *effect, + ClutterEffectPaintFlags flags); + void (* pick) (ClutterEffect *effect, + ClutterEffectPaintFlags flags); /*< private >*/ void (* _clutter_effect4) (void); diff --git a/clutter/clutter-offscreen-effect.c b/clutter/clutter-offscreen-effect.c index ad6670bdb..bb5268a08 100644 --- a/clutter/clutter-offscreen-effect.c +++ b/clutter/clutter-offscreen-effect.c @@ -407,8 +407,8 @@ clutter_offscreen_effect_post_paint (ClutterEffect *effect) } static void -clutter_offscreen_effect_paint (ClutterEffect *effect, - ClutterEffectRunFlags flags) +clutter_offscreen_effect_paint (ClutterEffect *effect, + ClutterEffectPaintFlags flags) { ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect); ClutterOffscreenEffectPrivate *priv = self->priv; @@ -420,7 +420,7 @@ clutter_offscreen_effect_paint (ClutterEffect *effect, actor hasn't been redrawn then we can just use the cached image in the fbo */ if (priv->offscreen == NULL || - (flags & CLUTTER_EFFECT_RUN_ACTOR_DIRTY) || + (flags & CLUTTER_EFFECT_PAINT_ACTOR_DIRTY) || !cogl_matrix_equal (&matrix, &priv->last_matrix_drawn)) { /* Chain up to the parent paint method which will call the pre and diff --git a/tests/conform/test-pick.c b/tests/conform/test-pick.c index 3955f500d..01647d148 100644 --- a/tests/conform/test-pick.c +++ b/tests/conform/test-pick.c @@ -39,8 +39,8 @@ G_DEFINE_TYPE (ShiftEffect, CLUTTER_TYPE_SHADER_EFFECT); static void -shader_paint (ClutterEffect *effect, - ClutterEffectRunFlags flags) +shader_paint (ClutterEffect *effect, + ClutterEffectPaintFlags flags) { ClutterShaderEffect *shader = CLUTTER_SHADER_EFFECT (effect); float tex_width; @@ -68,8 +68,8 @@ shader_paint (ClutterEffect *effect, } static void -shader_pick (ClutterEffect *effect, - ClutterEffectRunFlags flags) +shader_pick (ClutterEffect *effect, + ClutterEffectPaintFlags flags) { shader_paint (effect, flags); }