diff options
author | Christopher Michael <cp.michael@samsung.com> | 2019-05-29 09:17:39 -0400 |
---|---|---|
committer | Christopher Michael <cp.michael@samsung.com> | 2019-05-29 09:48:51 -0400 |
commit | 274327c7b7b6bb1632ff8f58062f23bcc05c4a0f (patch) | |
tree | 3f79504b17c1fcccf5458f004072a58506868e0d | |
parent | 4ef3b6cddb37bcffe459d43f6b1497a4245ff016 (diff) | |
download | efl-274327c7b7b6bb1632ff8f58062f23bcc05c4a0f.tar.gz |
evas_inline: Clean up evas_inline.x
This file is full of functions called as:
foo(eo_obj, obj);
Most of them can be reduced to foo(obj); and internally get the eo_obj
with obj->object
This would make it impossible to screw up calling them passing an
unrelated pair, and make calling code a little more readable.
ref T7230
-rw-r--r-- | src/lib/evas/canvas/efl_canvas_vg_object.c | 4 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_clip.c | 4 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_image.c | 4 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_line.c | 2 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_polygon.c | 2 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_rectangle.c | 4 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_text.c | 2 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_textblock.c | 8 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_textgrid.c | 2 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_render.c | 54 | ||||
-rw-r--r-- | src/lib/evas/include/evas_inline.x | 6 |
11 files changed, 45 insertions, 47 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c index c350200593..1ef55538ff 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object.c @@ -642,7 +642,7 @@ _efl_canvas_vg_object_render_pre(Evas_Object *eo_obj, /* now figure what changed and add draw rects */ /* if it just became visible or invisible */ - is_v = evas_object_is_visible(eo_obj, obj); + is_v = evas_object_is_visible(obj); was_v = evas_object_was_visible(obj); if (!(is_v | was_v)) goto done; @@ -701,7 +701,7 @@ _efl_canvas_vg_object_render_pre(Evas_Object *eo_obj, /* it obviously didn't change - add a NO obscure - this "unupdates" this */ /* area so if there were updates for it they get wiped. don't do it if we */ /* arent fully opaque and we are visible */ - if (evas_object_is_visible(eo_obj, obj) && + if (evas_object_is_visible(obj) && evas_object_is_opaque(eo_obj, obj) && (!obj->clip.clipees)) { diff --git a/src/lib/evas/canvas/evas_clip.c b/src/lib/evas/canvas/evas_clip.c index 809c24f72a..d455e80979 100644 --- a/src/lib/evas/canvas/evas_clip.c +++ b/src/lib/evas/canvas/evas_clip.c @@ -380,7 +380,7 @@ _efl_canvas_object_clipper_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Evas evas_object_recalc_clippees(obj); if ((!obj->is_smart) && (!((obj->map->cur.map) && (obj->map->cur.usemap))) && - evas_object_is_visible(eo_obj, obj)) + evas_object_is_visible(obj)) { _evas_canvas_event_pointer_in_rect_mouse_move_feed(obj->layer->evas, eo_obj, @@ -430,7 +430,7 @@ _clip_unset(Eo *eo_obj, Evas_Object_Protected_Data *obj) if ((!obj->is_smart) && (!((obj->map->cur.map) && (obj->map->cur.usemap))) && - evas_object_is_visible(eo_obj, obj)) + evas_object_is_visible(obj)) { _evas_canvas_event_pointer_in_rect_mouse_move_feed(obj->layer->evas, eo_obj, diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 16ed8b5b0d..46a9c1e9c3 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -2293,7 +2293,7 @@ evas_object_image_render_pre(Evas_Object *eo_obj, /* now figure what changed and add draw rects */ /* if it just became visible or invisible */ - is_v = evas_object_is_visible(eo_obj, obj); + is_v = evas_object_is_visible(obj); was_v = evas_object_was_visible(obj); if (is_v != was_v) { @@ -3434,7 +3434,7 @@ _evas_object_image_video_overlay_hide(Evas_Object *eo_obj) o->delayed.video_hide = EINA_TRUE; o->delayed.video_show = EINA_FALSE; } - if (evas_object_is_visible(eo_obj, obj)) + if (evas_object_is_visible(obj)) o->pixels->video.update_pixels(o->pixels->video.data, eo_obj, &o->pixels->video); o->video_visible = EINA_FALSE; o->created = EINA_FALSE; diff --git a/src/lib/evas/canvas/evas_object_line.c b/src/lib/evas/canvas/evas_object_line.c index 9a83f10c42..ee085dcc5b 100644 --- a/src/lib/evas/canvas/evas_object_line.c +++ b/src/lib/evas/canvas/evas_object_line.c @@ -274,7 +274,7 @@ evas_object_line_render_pre(Evas_Object *eo_obj, } /* now figure what changed and add draw rects */ /* if it just became visible or invisible */ - is_v = evas_object_is_visible(eo_obj, obj); + is_v = evas_object_is_visible(obj); was_v = evas_object_was_visible(obj); if (is_v != was_v) { diff --git a/src/lib/evas/canvas/evas_object_polygon.c b/src/lib/evas/canvas/evas_object_polygon.c index 1aeadd9eae..f37b9f5b25 100644 --- a/src/lib/evas/canvas/evas_object_polygon.c +++ b/src/lib/evas/canvas/evas_object_polygon.c @@ -329,7 +329,7 @@ evas_object_polygon_render_pre(Evas_Object *eo_obj, } /* now figure what changed and add draw rects */ /* if it just became visible or invisible */ - is_v = evas_object_is_visible(eo_obj, obj); + is_v = evas_object_is_visible(obj); was_v = evas_object_was_visible(obj); if (is_v != was_v) { diff --git a/src/lib/evas/canvas/evas_object_rectangle.c b/src/lib/evas/canvas/evas_object_rectangle.c index d5a6600c04..b2f1aae310 100644 --- a/src/lib/evas/canvas/evas_object_rectangle.c +++ b/src/lib/evas/canvas/evas_object_rectangle.c @@ -158,7 +158,7 @@ evas_object_rectangle_render_pre(Evas_Object *eo_obj, } /* now figure what changed and add draw rects */ /* if it just became visible or invisible */ - is_v = evas_object_is_visible(eo_obj, obj); + is_v = evas_object_is_visible(obj); was_v = evas_object_was_visible(obj); if (!(is_v | was_v)) goto done; if (is_v != was_v) @@ -203,7 +203,7 @@ evas_object_rectangle_render_pre(Evas_Object *eo_obj, /* it obviously didn't change - add a NO obscure - this "unupdates" this */ /* area so if there were updates for it they get wiped. don't do it if we */ /* arent fully opaque and we are visible */ - if (evas_object_is_visible(eo_obj, obj) && + if (evas_object_is_visible(obj) && evas_object_is_opaque(eo_obj, obj) && (!obj->clip.clipees)) { diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 0c20f3ee38..40277e2ef4 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -2077,7 +2077,7 @@ evas_object_text_render_pre(Evas_Object *eo_obj, } /* now figure what changed and add draw rects if it just became visible or invisible */ - is_v = evas_object_is_visible(eo_obj, obj); + is_v = evas_object_is_visible(obj); was_v = evas_object_was_visible(obj); if (is_v != was_v) { diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index d4921f9683..87dc57fa65 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -15041,7 +15041,7 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj, o->redraw = 0; evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj); - is_v = evas_object_is_visible(eo_obj, obj); + is_v = evas_object_is_visible(obj); was_v = evas_object_was_visible(obj); goto done; } @@ -15051,7 +15051,7 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj, o->redraw = 0; evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj); - is_v = evas_object_is_visible(eo_obj, obj); + is_v = evas_object_is_visible(obj); was_v = evas_object_was_visible(obj); goto done; } @@ -15061,13 +15061,13 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj, o->redraw = 0; evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, eo_obj, obj); - is_v = evas_object_is_visible(eo_obj, obj); + is_v = evas_object_is_visible(obj); was_v = evas_object_was_visible(obj); goto done; } /* now figure what changed and add draw rects */ /* if it just became visible or invisible */ - is_v = evas_object_is_visible(eo_obj, obj); + is_v = evas_object_is_visible(obj); was_v = evas_object_was_visible(obj); if (is_v != was_v) { diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c index 854e829506..2b3b97c370 100644 --- a/src/lib/evas/canvas/evas_object_textgrid.c +++ b/src/lib/evas/canvas/evas_object_textgrid.c @@ -681,7 +681,7 @@ evas_object_textgrid_render_pre(Evas_Object *eo_obj, } /* now figure what changed and add draw rects */ /* if it just became visible or invisible */ - is_v = evas_object_is_visible(eo_obj, obj); + is_v = evas_object_is_visible(obj); was_v = evas_object_was_visible(obj); if (is_v != was_v) { diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index f355bac9c2..ce3ed0f737 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -286,16 +286,16 @@ _evas_render_had_map(Evas_Object_Protected_Data *obj) } static Eina_Bool -_evas_render_is_relevant(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) +_evas_render_is_relevant(Evas_Object_Protected_Data *obj) { - return ((evas_object_is_visible(eo_obj, obj) && (!obj->cur->have_clipees)) || + return ((evas_object_is_visible(obj) && (!obj->cur->have_clipees)) || (evas_object_was_visible(obj) && (!obj->prev->have_clipees))); } static Eina_Bool -_evas_render_can_render(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) +_evas_render_can_render(Evas_Object_Protected_Data *obj) { - return (evas_object_is_visible(eo_obj, obj) && (!obj->cur->have_clipees) && + return (evas_object_is_visible(obj) && (!obj->cur->have_clipees) && !obj->no_render); } @@ -519,7 +519,7 @@ _evas_render_phase1_direct(Evas_Public_Data *e, if (obj->is_smart) { } - else if (evas_object_is_visible(eo_obj, obj) && + else if (evas_object_is_visible(obj) && ((obj->rect_del) || (evas_object_is_opaque(eo_obj, obj))) && (!evas_object_is_source_invisible(eo_obj, obj))) @@ -789,7 +789,7 @@ _evas_render_phase1_object_mapped(Phase1_Context *p1ctx, _evas_render_object_map_change_update(p1ctx->e, obj, EINA_TRUE, hmap, &(p1ctx->redraw_all)); if (!((is_active) && (!obj->clip.clipees) && - ((evas_object_is_visible(eo_obj, obj) && + ((evas_object_is_visible(obj) && (!obj->cur->have_clipees)) || (evas_object_was_visible(obj) && (!obj->prev->have_clipees))))) @@ -923,9 +923,7 @@ _evas_render_phase1_object_changed_normal(Phase1_Context *p1ctx, #endif ) { - Evas_Object *eo_obj = obj->object; - - if ((!obj->clip.clipees) && _evas_render_is_relevant(eo_obj, obj)) + if ((!obj->clip.clipees) && _evas_render_is_relevant(obj)) { if (EINA_LIKELY(is_active)) { @@ -942,7 +940,7 @@ _evas_render_phase1_object_changed_normal(Phase1_Context *p1ctx, { /* It goes to be hidden. Prev caching should be replaced by the current (hidden) state. */ - if (evas_object_is_visible(eo_obj, obj) != + if (evas_object_is_visible(obj) != evas_object_was_visible(obj)) evas_object_cur_prev(obj); RD(level, " skip - not smart, not active or clippees or not relevant\n"); @@ -1035,13 +1033,13 @@ _evas_render_phase1_object_no_changed_normal(Phase1_Context *p1ctx, Evas_Object *eo_obj = obj->object; if (evas_object_is_opaque(eo_obj, obj) && - evas_object_is_visible(eo_obj, obj)) + evas_object_is_visible(obj)) { RD(level, " opaque + visible\n"); OBJ_ARRAY_PUSH(p1ctx->render_objects, obj); obj->rect_del = EINA_TRUE; } - else if (evas_object_is_visible(eo_obj, obj)) + else if (evas_object_is_visible(obj)) { RD(level, " visible\n"); OBJ_ARRAY_PUSH(p1ctx->render_objects, obj); @@ -1122,7 +1120,7 @@ _evas_render_phase1_object_process(Phase1_Context *p1ctx, eina_inarray_push(p1ctx->active_objects, &ent); } if (is_active && obj->cur->snapshot && !obj->delete_me && - evas_object_is_visible(eo_obj, obj)) + evas_object_is_visible(obj)) { // FIXME: Array should be clean (no need to check if already in there) int found = 0; @@ -1180,12 +1178,12 @@ _evas_render_phase1_object_process(Phase1_Context *p1ctx, { /* not changed */ RD(level, " not changed... [%i] -> (%i %i %p %i) [%i]\n", - evas_object_is_visible(eo_obj, obj), + evas_object_is_visible(obj), obj->cur->visible, obj->cur->cache.clip.visible, obj->smart.smart, obj->cur->cache.clip.a, evas_object_was_visible(obj)); if ((!obj->clip.clipees) && (EINA_LIKELY(obj->delete_me == 0)) && - (_evas_render_can_render(eo_obj, obj) || + (_evas_render_can_render(obj) || (evas_object_was_visible(obj) && (!obj->prev->have_clipees)))) { @@ -1294,7 +1292,7 @@ _evas_render_check_pending_objects(Eina_Array *pending_objects, Evas *eo_e EINA_ } else if ((is_active) && (obj->restack) && (!obj->clip.clipees) && - (_evas_render_can_render(eo_obj, obj) || + (_evas_render_can_render(obj) || (evas_object_was_visible(obj) && (!obj->prev->have_clipees)))) { if (!obj->render_pre && !obj->rect_del && !obj->delete_me) @@ -1302,7 +1300,7 @@ _evas_render_check_pending_objects(Eina_Array *pending_objects, Evas *eo_e EINA_ } else if (is_active && (!obj->clip.clipees) && - (_evas_render_can_render(eo_obj, obj) || + (_evas_render_can_render(obj) || (evas_object_was_visible(obj) && (!obj->prev->have_clipees)))) { if (obj->render_pre || obj->rect_del) ok = EINA_TRUE; @@ -1312,7 +1310,7 @@ _evas_render_check_pending_objects(Eina_Array *pending_objects, Evas *eo_e EINA_ { if ((!obj->clip.clipees) && (obj->delete_me == 0) && (!obj->cur->have_clipees || (evas_object_was_visible(obj) && (!obj->prev->have_clipees))) - && evas_object_is_opaque(eo_obj, obj) && evas_object_is_visible(eo_obj, obj)) + && evas_object_is_opaque(eo_obj, obj) && evas_object_is_visible(obj)) { if (obj->rect_del || obj->is_smart) ok = EINA_TRUE; } @@ -1348,7 +1346,7 @@ pending_change(void *data, void *gdata EINA_UNUSED) obj->func->render_post(eo_obj, obj, obj->private_data); obj->pre_render_done = EINA_FALSE; } - else if (!_evas_render_can_render(eo_obj, obj) && + else if (!_evas_render_can_render(obj) && (!obj->is_active) && (!obj->render_pre) && (!obj->rect_del)) { @@ -1399,7 +1397,7 @@ _evas_render_can_use_overlay(Evas_Public_Data *e, Evas_Object *eo_obj, Efl_Canva if (tmp && _evas_render_has_map(tmp) && !_evas_render_can_map(tmp)) return EINA_FALSE; /* we are mapped, we can't be an overlay */ - if (!evas_object_is_visible(eo_obj, obj)) + if (!evas_object_is_visible(obj)) return EINA_FALSE; /* no need to update the overlay if it's not visible */ /* If any recoloring of the surface is needed, n overlay to */ @@ -1502,7 +1500,7 @@ _evas_render_can_use_overlay(Evas_Public_Data *e, Evas_Object *eo_obj, Efl_Canva xc2 = current->cur->cache.clip.x + current->cur->cache.clip.w; yc2 = current->cur->cache.clip.y + current->cur->cache.clip.h; - if (evas_object_is_visible(eo_current, current) && + if (evas_object_is_visible(current) && (!current->clip.clipees) && (current->cur->visible) && (!current->delete_me) && @@ -1846,12 +1844,12 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, { if (!evas->is_frozen) /* same as "if (proxy_render_data)" */ { - if ((!evas_object_is_visible(eo_obj, obj)) || (obj->clip.clipees) + if ((!evas_object_is_visible(obj)) || (obj->clip.clipees) || (obj->cur->have_clipees) || (obj->no_render)) { IFRD(obj->no_render, level, " no_render\n"); IFRD(obj->clip.clipees || obj->cur->have_clipees, level, " has clippees\n"); - IFRD(!evas_object_is_visible(eo_obj, obj), level, " not visible\n"); + IFRD(!evas_object_is_visible(obj), level, " not visible\n"); RD(level, "}\n"); eina_evlog("-render_object", eo_obj, 0.0, NULL); return EINA_FALSE; @@ -1899,11 +1897,11 @@ evas_render_mapped(Evas_Public_Data *evas, Evas_Object *eo_obj, } } else if (!(((evas_object_is_active(eo_obj, obj) && (!obj->clip.clipees) && - (_evas_render_can_render(eo_obj, obj)))) + (_evas_render_can_render(obj)))) )) { IFRD(!evas_object_is_active(eo_obj, obj), level, " not active\n"); - IFRD(!_evas_render_can_render(eo_obj, obj), level, " can't render\n"); + IFRD(!_evas_render_can_render(obj), level, " can't render\n"); IFRD(obj->clip.clipees, level, " has clippees\n"); RD(level, "}\n"); eina_evlog("-render_object", eo_obj, 0.0, NULL); @@ -2758,7 +2756,7 @@ _snapshot_redraw_update(Evas_Public_Data *evas, Evas_Object_Protected_Data *snap // FIXME: Tiler should be inside snapshot data // TODO: Also list redraw regions (partial updates) - if (!evas_object_is_visible(snap->object, snap)) return; + if (!evas_object_is_visible(snap)) return; evas_object_clip_recalc(snap); snap_clip.x = snap->cur->cache.clip.x - x; @@ -3123,7 +3121,7 @@ _evas_planes(Evas_Public_Data *evas) break; } - if (evas_object_is_visible(eo_obj2, obj2)) + if (evas_object_is_visible(obj2)) EINA_LIST_FOREACH(evas->outputs, lo, output) { /* A video object can only be in one output at a time, check that first */ @@ -3331,7 +3329,7 @@ evas_render_updates_internal(Evas *eo_e, (evas_object_is_opaque(eo_obj, obj) || obj->cur->snapshot || ((obj->func->has_opaque_rect) && (obj->func->has_opaque_rect(eo_obj, obj, obj->private_data)))) && - evas_object_is_visible(eo_obj, obj) && + evas_object_is_visible(obj) && (!obj->mask->is_mask) && (!obj->clip.mask) && (!obj->delete_me))) OBJ_ARRAY_PUSH(&e->obscuring_objects, obj); diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x index 7c337b3f2e..ad6fca2dbb 100644 --- a/src/lib/evas/include/evas_inline.x +++ b/src/lib/evas/include/evas_inline.x @@ -178,7 +178,7 @@ evas_object_is_source_invisible(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Pro } static inline int -evas_object_is_visible(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) +evas_object_is_visible(Evas_Object_Protected_Data *obj) { if (EINA_UNLIKELY(!obj->cur)) return 0; if ((obj->cur->visible) && (!obj->no_render) && @@ -187,7 +187,7 @@ evas_object_is_visible(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) || obj->cur->render_op != EVAS_RENDER_BLEND)) { if (obj->func->is_visible) - return obj->func->is_visible(eo_obj); + return obj->func->is_visible(obj->object); return 1; } return 0; @@ -240,7 +240,7 @@ evas_object_is_in_output_rect(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Prote static inline int evas_object_is_active(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) { - if (evas_object_is_visible(eo_obj, obj) || evas_object_was_visible(obj)) + if (evas_object_is_visible(obj) || evas_object_was_visible(obj)) { Evas_Public_Data *e = obj->layer->evas; int fx, fy; |