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
This commit is contained in:
Emmanuele Bassi 2011-06-13 15:58:46 +01:00
parent 0ede622f51
commit 74a9b71060
6 changed files with 43 additions and 45 deletions

View File

@ -2991,7 +2991,7 @@ clutter_actor_continue_paint (ClutterActor *self)
else else
{ {
ClutterEffect *old_current_effect; ClutterEffect *old_current_effect;
ClutterEffectRunFlags run_flags = 0; ClutterEffectPaintFlags run_flags = 0;
/* Cache the current effect so that we can put it back before /* Cache the current effect so that we can put it back before
returning */ returning */
@ -3011,7 +3011,7 @@ clutter_actor_continue_paint (ClutterActor *self)
(although it should work ok if it does) */ (although it should work ok if it does) */
if (priv->effect_to_redraw == NULL || if (priv->effect_to_redraw == NULL ||
priv->current_effect != priv->effect_to_redraw) 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); _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 /* We can't determine when an actor has been modified since
its last pick so lets just assume it has always been its last pick so lets just assume it has always been
modified */ modified */
run_flags |= CLUTTER_EFFECT_RUN_ACTOR_DIRTY; run_flags |= CLUTTER_EFFECT_PAINT_ACTOR_DIRTY;
_clutter_effect_pick (priv->current_effect, run_flags); _clutter_effect_pick (priv->current_effect, run_flags);
} }

View File

@ -5,14 +5,14 @@
G_BEGIN_DECLS G_BEGIN_DECLS
gboolean _clutter_effect_pre_paint (ClutterEffect *effect); gboolean _clutter_effect_pre_paint (ClutterEffect *effect);
void _clutter_effect_post_paint (ClutterEffect *effect); void _clutter_effect_post_paint (ClutterEffect *effect);
gboolean _clutter_effect_get_paint_volume (ClutterEffect *effect, gboolean _clutter_effect_get_paint_volume (ClutterEffect *effect,
ClutterPaintVolume *volume); ClutterPaintVolume *volume);
void _clutter_effect_paint (ClutterEffect *effect, void _clutter_effect_paint (ClutterEffect *effect,
ClutterEffectRunFlags flags); ClutterEffectPaintFlags flags);
void _clutter_effect_pick (ClutterEffect *effect, void _clutter_effect_pick (ClutterEffect *effect,
ClutterEffectRunFlags flags); ClutterEffectPaintFlags flags);
G_END_DECLS G_END_DECLS

View File

@ -44,7 +44,7 @@
* something like this: * something like this:
* </para> * </para>
* <programlisting> * <programlisting>
* void effect_paint (ClutterEffect *effect, ClutterEffectRunFlags flags) * void effect_paint (ClutterEffect *effect, ClutterEffectPaintFlags flags)
* { * {
* /&ast; Set up initialisation of the paint such as binding a * /&ast; Set up initialisation of the paint such as binding a
* CoglOffscreen or other operations &ast;/ * CoglOffscreen or other operations &ast;/
@ -228,8 +228,8 @@ clutter_effect_real_get_paint_volume (ClutterEffect *effect,
} }
static void static void
clutter_effect_real_paint (ClutterEffect *effect, clutter_effect_real_paint (ClutterEffect *effect,
ClutterEffectRunFlags flags) ClutterEffectPaintFlags flags)
{ {
ClutterActorMeta *actor_meta = CLUTTER_ACTOR_META (effect); ClutterActorMeta *actor_meta = CLUTTER_ACTOR_META (effect);
ClutterActor *actor; ClutterActor *actor;
@ -249,8 +249,8 @@ clutter_effect_real_paint (ClutterEffect *effect,
} }
static void static void
clutter_effect_real_pick (ClutterEffect *effect, clutter_effect_real_pick (ClutterEffect *effect,
ClutterEffectRunFlags flags) ClutterEffectPaintFlags flags)
{ {
ClutterActorMeta *actor_meta = CLUTTER_ACTOR_META (effect); ClutterActorMeta *actor_meta = CLUTTER_ACTOR_META (effect);
ClutterActor *actor; ClutterActor *actor;
@ -312,8 +312,8 @@ _clutter_effect_post_paint (ClutterEffect *effect)
} }
void void
_clutter_effect_paint (ClutterEffect *effect, _clutter_effect_paint (ClutterEffect *effect,
ClutterEffectRunFlags flags) ClutterEffectPaintFlags flags)
{ {
g_return_if_fail (CLUTTER_IS_EFFECT (effect)); g_return_if_fail (CLUTTER_IS_EFFECT (effect));
@ -321,8 +321,8 @@ _clutter_effect_paint (ClutterEffect *effect,
} }
void void
_clutter_effect_pick (ClutterEffect *effect, _clutter_effect_pick (ClutterEffect *effect,
ClutterEffectRunFlags flags) ClutterEffectPaintFlags flags)
{ {
g_return_if_fail (CLUTTER_IS_EFFECT (effect)); g_return_if_fail (CLUTTER_IS_EFFECT (effect));

View File

@ -43,18 +43,17 @@ G_BEGIN_DECLS
typedef struct _ClutterEffectClass ClutterEffectClass; typedef struct _ClutterEffectClass ClutterEffectClass;
/** /**
* ClutterEffectRunFlags: * ClutterEffectPaintFlags:
* @CLUTTER_EFFECT_RUN_ACTOR_DIRTY: The actor or one of its children * @CLUTTER_EFFECT_PAINT_ACTOR_DIRTY: The actor or one of its children
* has queued a redraw before this paint. This implies that the effect * has queued a redraw before this paint. This implies that the effect
* should call clutter_actor_continue_paint() to chain to the next * should call clutter_actor_continue_paint() to chain to the next
* effect and can not cache any results from a previous paint. * effect and can not cache any results from a previous paint.
* *
* Flags passed to the paint or pick method of #ClutterEffect. * Flags passed to the paint or pick method of #ClutterEffect.
*/ */
typedef enum typedef enum { /*< prefix=CLUTTER_EFFECT_PAINT >*/
{ CLUTTER_EFFECT_PAINT_ACTOR_DIRTY = (1 << 0)
CLUTTER_EFFECT_RUN_ACTOR_DIRTY = (1 << 0) } ClutterEffectPaintFlags;
} ClutterEffectRunFlags;
/** /**
* ClutterEffect: * ClutterEffect:
@ -87,17 +86,16 @@ struct _ClutterEffectClass
ClutterActorMetaClass parent_class; ClutterActorMetaClass parent_class;
/*< public >*/ /*< public >*/
gboolean (* pre_paint) (ClutterEffect *effect); gboolean (* pre_paint) (ClutterEffect *effect);
void (* post_paint) (ClutterEffect *effect); void (* post_paint) (ClutterEffect *effect);
gboolean (* get_paint_volume) (ClutterEffect *effect, gboolean (* get_paint_volume) (ClutterEffect *effect,
ClutterPaintVolume *volume); ClutterPaintVolume *volume);
void (* paint) (ClutterEffect *effect, void (* paint) (ClutterEffect *effect,
ClutterEffectRunFlags flags); ClutterEffectPaintFlags flags);
void (* pick) (ClutterEffect *effect,
void (* pick) (ClutterEffect *effect, ClutterEffectPaintFlags flags);
ClutterEffectRunFlags flags);
/*< private >*/ /*< private >*/
void (* _clutter_effect4) (void); void (* _clutter_effect4) (void);

View File

@ -407,8 +407,8 @@ clutter_offscreen_effect_post_paint (ClutterEffect *effect)
} }
static void static void
clutter_offscreen_effect_paint (ClutterEffect *effect, clutter_offscreen_effect_paint (ClutterEffect *effect,
ClutterEffectRunFlags flags) ClutterEffectPaintFlags flags)
{ {
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect); ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
ClutterOffscreenEffectPrivate *priv = self->priv; 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 actor hasn't been redrawn then we can just use the cached image
in the fbo */ in the fbo */
if (priv->offscreen == NULL || if (priv->offscreen == NULL ||
(flags & CLUTTER_EFFECT_RUN_ACTOR_DIRTY) || (flags & CLUTTER_EFFECT_PAINT_ACTOR_DIRTY) ||
!cogl_matrix_equal (&matrix, &priv->last_matrix_drawn)) !cogl_matrix_equal (&matrix, &priv->last_matrix_drawn))
{ {
/* Chain up to the parent paint method which will call the pre and /* Chain up to the parent paint method which will call the pre and

View File

@ -39,8 +39,8 @@ G_DEFINE_TYPE (ShiftEffect,
CLUTTER_TYPE_SHADER_EFFECT); CLUTTER_TYPE_SHADER_EFFECT);
static void static void
shader_paint (ClutterEffect *effect, shader_paint (ClutterEffect *effect,
ClutterEffectRunFlags flags) ClutterEffectPaintFlags flags)
{ {
ClutterShaderEffect *shader = CLUTTER_SHADER_EFFECT (effect); ClutterShaderEffect *shader = CLUTTER_SHADER_EFFECT (effect);
float tex_width; float tex_width;
@ -68,8 +68,8 @@ shader_paint (ClutterEffect *effect,
} }
static void static void
shader_pick (ClutterEffect *effect, shader_pick (ClutterEffect *effect,
ClutterEffectRunFlags flags) ClutterEffectPaintFlags flags)
{ {
shader_paint (effect, flags); shader_paint (effect, flags);
} }