summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-02-20 20:24:21 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-02-21 10:52:40 +0900
commitcbb804f814915a74c3fd4dcc84e8dd6c66ec9b9f (patch)
treeb013942c4f3aa51193191d6a48f59431ee3f6884 /src/lib
parent0d555dda7f2f8cb86d097ca713aa5ca61aac4ff7 (diff)
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
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/evas/canvas/evas_object_main.c17
-rw-r--r--src/lib/evas/include/evas_inline.x17
-rw-r--r--src/lib/evas/include/evas_private.h2
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 293d71c6fc..96a37e2fc3 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
210} Map_Same; 210} Map_Same;
211 211
212void 212void
213evas_object_clip_recalc(Evas_Object_Protected_Data *obj) 213evas_object_clip_recalc_do(Evas_Object_Protected_Data *obj, Evas_Object_Protected_Data *clipper)
214{ 214{
215 Evas_Object_Protected_Data *clipper = NULL;
216 int cx, cy, cw, ch, cr, cg, cb, ca; 215 int cx, cy, cw, ch, cr, cg, cb, ca;
217 int nx, ny, nw, nh, nr, ng, nb, na; 216 int nx, ny, nw, nh, nr, ng, nb, na;
218 Eina_Bool cvis, nvis; 217 Eina_Bool cvis, nvis;
219 Evas_Object *eo_obj;
220 218
221 EVAS_OBJECT_DATA_ALIVE_CHECK(obj); 219 evas_object_coords_recalc(obj->object, obj);
222
223 clipper = obj->cur->clipper;
224
225 if (EINA_LIKELY(((!obj->cur->cache.clip.dirty) &&
226 !(!clipper || clipper->cur->cache.clip.dirty)))) return;
227
228 if (EINA_UNLIKELY(obj->layer->evas->is_frozen)) return;
229
230 eo_obj = obj->object;
231
232 evas_object_coords_recalc(eo_obj, obj);
233 220
234 if (EINA_UNLIKELY((!!obj->map) && (obj->map->cur.map) && (obj->map->cur.usemap))) 221 if (EINA_UNLIKELY((!!obj->map) && (obj->map->cur.map) && (obj->map->cur.usemap)))
235 { 222 {
diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x
index 38b8360047..ec53d6d388 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)
272} 272}
273 273
274static inline void 274static inline void
275evas_object_clip_recalc(Evas_Object_Protected_Data *obj)
276{
277 Evas_Object_Protected_Data *clipper = NULL;
278
279 EVAS_OBJECT_DATA_ALIVE_CHECK(obj);
280
281 clipper = obj->cur->clipper;
282
283 if (EINA_LIKELY(((!obj->cur->cache.clip.dirty) &&
284 !(!clipper || clipper->cur->cache.clip.dirty)))) return;
285
286 if (EINA_UNLIKELY(obj->layer->evas->is_frozen)) return;
287
288 evas_object_clip_recalc_do(obj, clipper);
289}
290
291static inline void
275evas_object_async_block(Evas_Object_Protected_Data *obj) 292evas_object_async_block(Evas_Object_Protected_Data *obj)
276{ 293{
277 if (EVAS_OBJECT_DATA_VALID(obj)) 294 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 dbdff9e4ff..356f3bef8c 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1599,7 +1599,7 @@ extern "C" {
1599 1599
1600Evas_Object *evas_object_new(Evas *e); 1600Evas_Object *evas_object_new(Evas *e);
1601void evas_object_change_reset(Evas_Object_Protected_Data *obj); 1601void evas_object_change_reset(Evas_Object_Protected_Data *obj);
1602void evas_object_clip_recalc(Evas_Object_Protected_Data *obj); 1602void evas_object_clip_recalc_do(Evas_Object_Protected_Data *obj, Evas_Object_Protected_Data *clipper);
1603void evas_object_cur_prev(Evas_Object_Protected_Data *obj); 1603void evas_object_cur_prev(Evas_Object_Protected_Data *obj);
1604void evas_object_free(Evas_Object *obj, Eina_Bool clean_layer); 1604void evas_object_free(Evas_Object *obj, Eina_Bool clean_layer);
1605void evas_object_update_bounding_box(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Smart_Data *s); 1605void evas_object_update_bounding_box(Evas_Object *obj, Evas_Object_Protected_Data *pd, Evas_Smart_Data *s);