jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=cbb804f814915a74c3fd4dcc84e8dd6c66ec9b9f
commit cbb804f814915a74c3fd4dcc84e8dd6c66ec9b9f Author: Jean-Philippe Andre <jp.an...@samsung.com> Date: Mon Feb 20 20:24:21 2017 +0900 evas: Inline part of clip_recalc This function was moved out of inline (see d7c6fca6c00a0bfb05) but unfortunately the early checks at its beginning are likely to result in an early return. Inline this part so we get back a better performance. Inlining the whole function does not improve the performance, as GCC simply gives up with inlining. Note: Between 1.18 and master the number of calls to clip_recalc has simply blown out. It is thus crucial to find out where those calls come from but also micro-optimize the function itself. This patch does the latter only. @optimize --- src/lib/evas/canvas/evas_object_main.c | 17 ++--------------- src/lib/evas/include/evas_inline.x | 17 +++++++++++++++++ src/lib/evas/include/evas_private.h | 2 +- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index 293d71c..96a37e2 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -210,26 +210,13 @@ typedef struct _Map_Same } Map_Same; void -evas_object_clip_recalc(Evas_Object_Protected_Data *obj) +evas_object_clip_recalc_do(Evas_Object_Protected_Data *obj, Evas_Object_Protected_Data *clipper) { - Evas_Object_Protected_Data *clipper = NULL; int cx, cy, cw, ch, cr, cg, cb, ca; int nx, ny, nw, nh, nr, ng, nb, na; Eina_Bool cvis, nvis; - Evas_Object *eo_obj; - EVAS_OBJECT_DATA_ALIVE_CHECK(obj); - - clipper = obj->cur->clipper; - - if (EINA_LIKELY(((!obj->cur->cache.clip.dirty) && - !(!clipper || clipper->cur->cache.clip.dirty)))) return; - - if (EINA_UNLIKELY(obj->layer->evas->is_frozen)) return; - - eo_obj = obj->object; - - evas_object_coords_recalc(eo_obj, obj); + evas_object_coords_recalc(obj->object, obj); if (EINA_UNLIKELY((!!obj->map) && (obj->map->cur.map) && (obj->map->cur.usemap))) { diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x index 38b8360..ec53d6d 100644 --- a/src/lib/evas/include/evas_inline.x +++ b/src/lib/evas/include/evas_inline.x @@ -272,6 +272,23 @@ evas_object_coords_recalc(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) } static inline void +evas_object_clip_recalc(Evas_Object_Protected_Data *obj) +{ + Evas_Object_Protected_Data *clipper = NULL; + + EVAS_OBJECT_DATA_ALIVE_CHECK(obj); + + clipper = obj->cur->clipper; + + if (EINA_LIKELY(((!obj->cur->cache.clip.dirty) && + !(!clipper || clipper->cur->cache.clip.dirty)))) return; + + if (EINA_UNLIKELY(obj->layer->evas->is_frozen)) return; + + evas_object_clip_recalc_do(obj, clipper); +} + +static inline void evas_object_async_block(Evas_Object_Protected_Data *obj) { if (EVAS_OBJECT_DATA_VALID(obj)) diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index dbdff9e..356f3be 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1599,7 +1599,7 @@ extern "C" { Evas_Object *evas_object_new(Evas *e); void evas_object_change_reset(Evas_Object_Protected_Data *obj); -void evas_object_clip_recalc(Evas_Object_Protected_Data *obj); +void evas_object_clip_recalc_do(Evas_Object_Protected_Data *obj, Evas_Object_Protected_Data *clipper); void evas_object_cur_prev(Evas_Object_Protected_Data *obj); void evas_object_free(Evas_Object *obj, Eina_Bool clean_layer); void evas_object_update_bounding_box(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Smart_Data *s); --