Rename ClutterEffect::run to ClutterEffect::paint

In preparation for adding ClutterEffect::pick

https://bugzilla.gnome.org/show_bug.cgi?id=651700
This commit is contained in:
Tomeu Vizoso 2011-06-06 08:44:11 +02:00 committed by Emmanuele Bassi
parent 165b2f9599
commit 700c543850
5 changed files with 29 additions and 29 deletions

View File

@ -3009,7 +3009,7 @@ clutter_actor_continue_paint (ClutterActor *self)
run_flags |= CLUTTER_EFFECT_RUN_ACTOR_DIRTY; run_flags |= CLUTTER_EFFECT_RUN_ACTOR_DIRTY;
} }
_clutter_effect_run (priv->current_effect, run_flags); _clutter_effect_paint (priv->current_effect, run_flags);
priv->current_effect = old_current_effect; priv->current_effect = old_current_effect;
} }

View File

@ -9,7 +9,7 @@ gboolean _clutter_effect_pre_paint (ClutterEffect *eff
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_run (ClutterEffect *effect, void _clutter_effect_paint (ClutterEffect *effect,
ClutterEffectRunFlags flags); ClutterEffectRunFlags flags);
G_END_DECLS G_END_DECLS

View File

@ -40,17 +40,17 @@
* <title>Implementing a ClutterEffect</title> * <title>Implementing a ClutterEffect</title>
* <para> * <para>
* Creating a sub-class of #ClutterEffect requires overriding the * Creating a sub-class of #ClutterEffect requires overriding the
* run method. The implementation of the function should look * paint method. The implementation of the function should look
* something like this: * something like this:
* </para> * </para>
* <programlisting> * <programlisting>
* void effect_run (ClutterEffect *effect, ClutterEffectRunFlags flags) * void effect_paint (ClutterEffect *effect, ClutterEffectRunFlags 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;/
* *
* /&ast; Chain to the next item in the paint sequence. This will either call * /&ast; Chain to the next item in the paint sequence. This will either call
* run on the next effect or just paint the actor if this is * paint on the next effect or just paint the actor if this is
* the last effect. &ast;/ * the last effect. &ast;/
* ClutterActor *actor = * ClutterActor *actor =
* clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (effect)); * clutter_actor_meta_get_actor (CLUTTER_ACTOR_META (effect));
@ -73,7 +73,7 @@
* cached image is still valid. * cached image is still valid.
* </para> * </para>
* <para> * <para>
* The run virtual was added in Clutter 1.8. Prior to that there * The paint virtual was added in Clutter 1.8. Prior to that there
* were two separate functions as follows. * were two separate functions as follows.
* </para> * </para>
* <itemizedlist> * <itemizedlist>
@ -90,10 +90,10 @@
* #ClutterActor's paint sequence.</para> * #ClutterActor's paint sequence.</para>
* <para> * <para>
* With these two functions it is not possible to skip the rest of * With these two functions it is not possible to skip the rest of
* the paint sequence. The default implementation of the run * the paint sequence. The default implementation of the paint
* virtual calls pre_paint(), clutter_actor_continue_paint() and * virtual calls pre_paint(), clutter_actor_continue_paint() and
* then post_paint() so that existing actors that aren't using the * then post_paint() so that existing actors that aren't using the
* run virtual will continue to work. New actors using the run * paint virtual will continue to work. New actors using the paint
* virtual do not need to implement pre or post paint. * virtual do not need to implement pre or post paint.
* </para> * </para>
* <example id="ClutterEffect-example"> * <example id="ClutterEffect-example">
@ -102,7 +102,7 @@
* painted "behind" the actor, while another will be painted "on * painted "behind" the actor, while another will be painted "on
* top" of the actor. The <function>set_actor()</function> * top" of the actor. The <function>set_actor()</function>
* implementation will create the two materials used for the two * implementation will create the two materials used for the two
* different rectangles; the <function>run()</function> function * different rectangles; the <function>paint()</function> function
* will paint the first material using cogl_rectangle(), before * will paint the first material using cogl_rectangle(), before
* continuing and then it will paint paint the second material * continuing and then it will paint paint the second material
* after.</para> * after.</para>
@ -156,7 +156,7 @@
* } * }
* *
* static gboolean * static gboolean
* my_effect_run (ClutterEffect *effect) * my_effect_paint (ClutterEffect *effect)
* { * {
* MyEffect *self = MY_EFFECT (effect); * MyEffect *self = MY_EFFECT (effect);
* gfloat width, height; * gfloat width, height;
@ -182,7 +182,7 @@
* *
* meta_class-&gt;set_actor = my_effect_set_actor; * meta_class-&gt;set_actor = my_effect_set_actor;
* *
* klass-&gt;run = my_effect_run; * klass-&gt;paint = my_effect_paint;
* } * }
* </programlisting> * </programlisting>
* </example> * </example>
@ -228,7 +228,7 @@ clutter_effect_real_get_paint_volume (ClutterEffect *effect,
} }
static void static void
clutter_effect_real_run (ClutterEffect *effect, clutter_effect_real_paint (ClutterEffect *effect,
ClutterEffectRunFlags flags) ClutterEffectRunFlags flags)
{ {
ClutterActorMeta *actor_meta = CLUTTER_ACTOR_META (effect); ClutterActorMeta *actor_meta = CLUTTER_ACTOR_META (effect);
@ -236,7 +236,7 @@ clutter_effect_real_run (ClutterEffect *effect,
gboolean pre_paint_succeeded; gboolean pre_paint_succeeded;
/* The default implementation provides a compatibility wrapper for /* The default implementation provides a compatibility wrapper for
effects that haven't migrated to use the 'run' virtual yet. This effects that haven't migrated to use the 'paint' virtual yet. This
just calls the old pre and post virtuals before chaining on */ just calls the old pre and post virtuals before chaining on */
pre_paint_succeeded = _clutter_effect_pre_paint (effect); pre_paint_succeeded = _clutter_effect_pre_paint (effect);
@ -275,7 +275,7 @@ clutter_effect_class_init (ClutterEffectClass *klass)
klass->pre_paint = clutter_effect_real_pre_paint; klass->pre_paint = clutter_effect_real_pre_paint;
klass->post_paint = clutter_effect_real_post_paint; klass->post_paint = clutter_effect_real_post_paint;
klass->get_paint_volume = clutter_effect_real_get_paint_volume; klass->get_paint_volume = clutter_effect_real_get_paint_volume;
klass->run = clutter_effect_real_run; klass->paint = clutter_effect_real_paint;
} }
static void static void
@ -300,12 +300,12 @@ _clutter_effect_post_paint (ClutterEffect *effect)
} }
void void
_clutter_effect_run (ClutterEffect *effect, _clutter_effect_paint (ClutterEffect *effect,
ClutterEffectRunFlags flags) ClutterEffectRunFlags flags)
{ {
g_return_if_fail (CLUTTER_IS_EFFECT (effect)); g_return_if_fail (CLUTTER_IS_EFFECT (effect));
CLUTTER_EFFECT_GET_CLASS (effect)->run (effect, flags); CLUTTER_EFFECT_GET_CLASS (effect)->paint (effect, flags);
} }
gboolean gboolean
@ -319,10 +319,10 @@ _clutter_effect_get_paint_volume (ClutterEffect *effect,
} }
/** /**
* clutter_effect_queue_rerun: * clutter_effect_queue_repaint:
* @effect: A #ClutterEffect which needs redrawing * @effect: A #ClutterEffect which needs redrawing
* *
* Queues a rerun of the effect. The effect can detect when the run * Queues a repaint of the effect. The effect can detect when the paint
* method is called as a result of this function because it will not * method is called as a result of this function because it will not
* have the %CLUTTER_EFFECT_RUN_ACTOR_DIRTY flag set. In that case the * have the %CLUTTER_EFFECT_RUN_ACTOR_DIRTY flag set. In that case the
* effect is free to assume that the actor has not changed its * effect is free to assume that the actor has not changed its
@ -339,7 +339,7 @@ _clutter_effect_get_paint_volume (ClutterEffect *effect,
* red tint to an actor by redirecting it through a CoglOffscreen * red tint to an actor by redirecting it through a CoglOffscreen
* might have a property to specify the level of tint. When this value * might have a property to specify the level of tint. When this value
* changes, the underlying actor doesn't need to be redrawn so the * changes, the underlying actor doesn't need to be redrawn so the
* effect can call clutter_effect_queue_rerun() to make sure the * effect can call clutter_effect_queue_repaint() to make sure the
* effect is repainted. * effect is repainted.
* *
* Note however that modifying the position of the parent of an actor * Note however that modifying the position of the parent of an actor
@ -361,7 +361,7 @@ _clutter_effect_get_paint_volume (ClutterEffect *effect,
* Since: 1.8 * Since: 1.8
*/ */
void void
clutter_effect_queue_rerun (ClutterEffect *effect) clutter_effect_queue_repaint (ClutterEffect *effect)
{ {
ClutterActor *actor; ClutterActor *actor;

View File

@ -75,7 +75,7 @@ struct _ClutterEffect
* @pre_paint: virtual function * @pre_paint: virtual function
* @post_paint: virtual function * @post_paint: virtual function
* @get_paint_volume: virtual function * @get_paint_volume: virtual function
* @run: virtual function * @paint: virtual function
* *
* The #ClutterEffectClass structure contains only private data * The #ClutterEffectClass structure contains only private data
* *
@ -93,7 +93,7 @@ struct _ClutterEffectClass
gboolean (* get_paint_volume) (ClutterEffect *effect, gboolean (* get_paint_volume) (ClutterEffect *effect,
ClutterPaintVolume *volume); ClutterPaintVolume *volume);
void (* run) (ClutterEffect *effect, void (* paint) (ClutterEffect *effect,
ClutterEffectRunFlags flags); ClutterEffectRunFlags flags);
/*< private >*/ /*< private >*/

View File

@ -407,7 +407,7 @@ clutter_offscreen_effect_post_paint (ClutterEffect *effect)
} }
static void static void
clutter_offscreen_effect_run (ClutterEffect *effect, clutter_offscreen_effect_paint (ClutterEffect *effect,
ClutterEffectRunFlags flags) ClutterEffectRunFlags flags)
{ {
ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect); ClutterOffscreenEffect *self = CLUTTER_OFFSCREEN_EFFECT (effect);
@ -423,10 +423,10 @@ clutter_offscreen_effect_run (ClutterEffect *effect,
(flags & CLUTTER_EFFECT_RUN_ACTOR_DIRTY) || (flags & CLUTTER_EFFECT_RUN_ACTOR_DIRTY) ||
!cogl_matrix_equal (&matrix, &priv->last_matrix_drawn)) !cogl_matrix_equal (&matrix, &priv->last_matrix_drawn))
{ {
/* Chain up to the parent run method which will call the pre and /* Chain up to the parent paint method which will call the pre and
post paint functions to update the image */ post paint functions to update the image */
CLUTTER_EFFECT_CLASS (clutter_offscreen_effect_parent_class)-> CLUTTER_EFFECT_CLASS (clutter_offscreen_effect_parent_class)->
run (effect, flags); paint (effect, flags);
} }
else else
clutter_offscreen_effect_paint_texture (self); clutter_offscreen_effect_paint_texture (self);
@ -463,7 +463,7 @@ clutter_offscreen_effect_class_init (ClutterOffscreenEffectClass *klass)
effect_class->pre_paint = clutter_offscreen_effect_pre_paint; effect_class->pre_paint = clutter_offscreen_effect_pre_paint;
effect_class->post_paint = clutter_offscreen_effect_post_paint; effect_class->post_paint = clutter_offscreen_effect_post_paint;
effect_class->run = clutter_offscreen_effect_run; effect_class->paint = clutter_offscreen_effect_paint;
gobject_class->finalize = clutter_offscreen_effect_finalize; gobject_class->finalize = clutter_offscreen_effect_finalize;
} }