From c237bc5f455d0f4226640ec1639b529b5e767943 Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Wed, 23 May 2018 14:46:40 +0800 Subject: [PATCH] clutter-effect: Rename get_paint_volume `_clutter_effect_get_paint_volume` was misleading. Its only purpose is to modify an existing paint volume. So change `get` to `modify`. https://gitlab.gnome.org/GNOME/mutter/merge_requests/115 --- clutter/clutter/clutter-actor.c | 4 ++-- clutter/clutter/clutter-blur-effect.c | 6 +++--- clutter/clutter/clutter-effect-private.h | 2 +- clutter/clutter/clutter-effect.c | 15 ++++++++------- clutter/clutter/clutter-effect.h | 18 +++++++++--------- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index 3c48e4e9a..1fd6663b2 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -17551,7 +17551,7 @@ _clutter_actor_get_paint_volume_real (ClutterActor *self, l != NULL && l->data != priv->current_effect; l = l->next) { - if (!_clutter_effect_get_paint_volume (l->data, pv)) + if (!_clutter_effect_modify_paint_volume (l->data, pv)) { clutter_paint_volume_free (pv); CLUTTER_NOTE (CLIPPING, "Bail from get_paint_volume (%s): " @@ -17569,7 +17569,7 @@ _clutter_actor_get_paint_volume_real (ClutterActor *self, /* otherwise, get the cumulative volume */ effects = _clutter_meta_group_peek_metas (priv->effects); for (l = effects; l != NULL; l = l->next) - if (!_clutter_effect_get_paint_volume (l->data, pv)) + if (!_clutter_effect_modify_paint_volume (l->data, pv)) { clutter_paint_volume_free (pv); CLUTTER_NOTE (CLIPPING, "Bail from get_paint_volume (%s): " diff --git a/clutter/clutter/clutter-blur-effect.c b/clutter/clutter/clutter-blur-effect.c index 9a8cabbea..1ffb99c0f 100644 --- a/clutter/clutter/clutter-blur-effect.c +++ b/clutter/clutter/clutter-blur-effect.c @@ -178,8 +178,8 @@ clutter_blur_effect_paint_target (ClutterOffscreenEffect *effect) } static gboolean -clutter_blur_effect_get_paint_volume (ClutterEffect *effect, - ClutterPaintVolume *volume) +clutter_blur_effect_modify_paint_volume (ClutterEffect *effect, + ClutterPaintVolume *volume) { gfloat cur_width, cur_height; ClutterVertex origin; @@ -223,7 +223,7 @@ clutter_blur_effect_class_init (ClutterBlurEffectClass *klass) gobject_class->dispose = clutter_blur_effect_dispose; effect_class->pre_paint = clutter_blur_effect_pre_paint; - effect_class->get_paint_volume = clutter_blur_effect_get_paint_volume; + effect_class->modify_paint_volume = clutter_blur_effect_modify_paint_volume; offscreen_class = CLUTTER_OFFSCREEN_EFFECT_CLASS (klass); offscreen_class->paint_target = clutter_blur_effect_paint_target; diff --git a/clutter/clutter/clutter-effect-private.h b/clutter/clutter/clutter-effect-private.h index c1e9b3b7f..87f348460 100644 --- a/clutter/clutter/clutter-effect-private.h +++ b/clutter/clutter/clutter-effect-private.h @@ -7,7 +7,7 @@ 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, +gboolean _clutter_effect_modify_paint_volume (ClutterEffect *effect, ClutterPaintVolume *volume); gboolean _clutter_effect_has_custom_paint_volume (ClutterEffect *effect); void _clutter_effect_paint (ClutterEffect *effect, diff --git a/clutter/clutter/clutter-effect.c b/clutter/clutter/clutter-effect.c index 82cf671c4..a7c06d919 100644 --- a/clutter/clutter/clutter-effect.c +++ b/clutter/clutter/clutter-effect.c @@ -188,8 +188,8 @@ clutter_effect_real_post_paint (ClutterEffect *effect) } static gboolean -clutter_effect_real_get_paint_volume (ClutterEffect *effect, - ClutterPaintVolume *volume) +clutter_effect_real_modify_paint_volume (ClutterEffect *effect, + ClutterPaintVolume *volume) { return TRUE; } @@ -252,7 +252,7 @@ clutter_effect_class_init (ClutterEffectClass *klass) klass->pre_paint = clutter_effect_real_pre_paint; klass->post_paint = clutter_effect_real_post_paint; - klass->get_paint_volume = clutter_effect_real_get_paint_volume; + klass->modify_paint_volume = clutter_effect_real_modify_paint_volume; klass->paint = clutter_effect_real_paint; klass->pick = clutter_effect_real_pick; } @@ -297,13 +297,14 @@ _clutter_effect_pick (ClutterEffect *effect, } gboolean -_clutter_effect_get_paint_volume (ClutterEffect *effect, - ClutterPaintVolume *volume) +_clutter_effect_modify_paint_volume (ClutterEffect *effect, + ClutterPaintVolume *volume) { g_return_val_if_fail (CLUTTER_IS_EFFECT (effect), FALSE); g_return_val_if_fail (volume != NULL, FALSE); - return CLUTTER_EFFECT_GET_CLASS (effect)->get_paint_volume (effect, volume); + return CLUTTER_EFFECT_GET_CLASS (effect)->modify_paint_volume (effect, + volume); } gboolean @@ -311,7 +312,7 @@ _clutter_effect_has_custom_paint_volume (ClutterEffect *effect) { g_return_val_if_fail (CLUTTER_IS_EFFECT (effect), FALSE); - return CLUTTER_EFFECT_GET_CLASS (effect)->get_paint_volume != clutter_effect_real_get_paint_volume; + return CLUTTER_EFFECT_GET_CLASS (effect)->modify_paint_volume != clutter_effect_real_modify_paint_volume; } /** diff --git a/clutter/clutter/clutter-effect.h b/clutter/clutter/clutter-effect.h index d25a63e29..6f280d95b 100644 --- a/clutter/clutter/clutter-effect.h +++ b/clutter/clutter/clutter-effect.h @@ -60,7 +60,7 @@ struct _ClutterEffect * ClutterEffectClass: * @pre_paint: virtual function * @post_paint: virtual function - * @get_paint_volume: virtual function + * @modify_paint_volume: virtual function * @paint: virtual function * @pick: virtual function * @@ -74,16 +74,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 (* modify_paint_volume) (ClutterEffect *effect, + ClutterPaintVolume *volume); - void (* paint) (ClutterEffect *effect, - ClutterEffectPaintFlags flags); - void (* pick) (ClutterEffect *effect, - ClutterEffectPaintFlags flags); + void (* paint) (ClutterEffect *effect, + ClutterEffectPaintFlags flags); + void (* pick) (ClutterEffect *effect, + ClutterEffectPaintFlags flags); /*< private >*/ void (* _clutter_effect4) (void);