diff options
author | Christopher Michael <cp.michael@samsung.com> | 2019-05-29 15:37:07 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2019-05-29 15:37:36 -0400 |
commit | 70ea7ba9daa152796f94aa6b49857eb7ee4e09c6 (patch) | |
tree | b27379cb44b6139d371b70661abc3dd3b66006c5 | |
parent | c10a4dcd18ddcd306f06d99116658605ef82cc6b (diff) | |
download | efl-70ea7ba9daa152796f94aa6b49857eb7ee4e09c6.tar.gz |
evas_inline: Clean up evas_object_is_opaque function
Summary:
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
Depends on D9048
Reviewers: raster, cedric, zmike
Reviewed By: zmike
Subscribers: #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7230
Differential Revision: https://phab.enlightenment.org/D9049
-rw-r--r-- | src/lib/evas/canvas/efl_canvas_vg_object.c | 2 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_image.c | 8 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_rectangle.c | 2 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_render.c | 20 | ||||
-rw-r--r-- | src/lib/evas/include/evas_inline.x | 4 |
5 files changed, 17 insertions, 19 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c index 1ef55538ff..c4e7c2b861 100644 --- a/src/lib/evas/canvas/efl_canvas_vg_object.c +++ b/src/lib/evas/canvas/efl_canvas_vg_object.c @@ -702,7 +702,7 @@ _efl_canvas_vg_object_render_pre(Evas_Object *eo_obj, /* 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(obj) && - evas_object_is_opaque(eo_obj, obj) && + evas_object_is_opaque(obj) && (!obj->clip.clipees)) { Evas_Coord x, y, w, h; diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 46a9c1e9c3..081c42aabe 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -2422,7 +2422,7 @@ evas_object_image_render_pre(Evas_Object *eo_obj, Eina_Rectangle *rr; if ((!o->cur->has_alpha) && - (evas_object_is_opaque(eo_obj, obj)) && + (evas_object_is_opaque(obj)) && (obj->cur->color.a == 255)) { Evas_Coord x, y, w, h; @@ -2514,7 +2514,7 @@ evas_object_image_render_pre(Evas_Object *eo_obj, Eina_Rectangle *rr; if ((!o->cur->has_alpha) && - (evas_object_is_opaque(eo_obj, obj)) && + (evas_object_is_opaque(obj)) && (obj->cur->color.a == 255)) { Evas_Coord x, y, w, h; @@ -2614,7 +2614,7 @@ evas_object_image_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 */ /* aren't fully opaque and we are visible */ - if (evas_object_is_opaque(eo_obj, obj)) + if (evas_object_is_opaque(obj)) { Evas_Coord x, y, w, h; @@ -2753,7 +2753,7 @@ evas_object_image_is_opaque(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *cur_source = efl_data_scope_get(o->cur->source, EFL_CANVAS_OBJECT_CLASS); EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) { - state_write->opaque = evas_object_is_opaque(o->cur->source, cur_source); + state_write->opaque = evas_object_is_opaque(cur_source); } EINA_COW_IMAGE_STATE_WRITE_END(o, state_write); return o->cur->opaque; /* FIXME: Should go poke at the object */ diff --git a/src/lib/evas/canvas/evas_object_rectangle.c b/src/lib/evas/canvas/evas_object_rectangle.c index b2f1aae310..fe45eceaab 100644 --- a/src/lib/evas/canvas/evas_object_rectangle.c +++ b/src/lib/evas/canvas/evas_object_rectangle.c @@ -204,7 +204,7 @@ evas_object_rectangle_render_pre(Evas_Object *eo_obj, /* 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(obj) && - evas_object_is_opaque(eo_obj, obj) && + evas_object_is_opaque(obj) && (!obj->clip.clipees)) { Evas_Coord x, y, w, h; diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 59d90bebb4..fe77fa7eba 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -521,7 +521,7 @@ _evas_render_phase1_direct(Evas_Public_Data *e, } else if (evas_object_is_visible(obj) && ((obj->rect_del) || - (evas_object_is_opaque(eo_obj, obj))) && + (evas_object_is_opaque(obj))) && (!evas_object_is_source_invisible(eo_obj, obj))) { RD(0, " rect del\n"); @@ -1030,9 +1030,7 @@ _evas_render_phase1_object_no_changed_normal(Phase1_Context *p1ctx, #endif ) { - Evas_Object *eo_obj = obj->object; - - if (evas_object_is_opaque(eo_obj, obj) && + if (evas_object_is_opaque(obj) && evas_object_is_visible(obj)) { RD(level, " opaque + visible\n"); @@ -1310,7 +1308,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(obj)) + && evas_object_is_opaque(obj) && evas_object_is_visible(obj)) { if (obj->rect_del || obj->is_smart) ok = EINA_TRUE; } @@ -1515,7 +1513,7 @@ _evas_render_can_use_overlay(Evas_Public_Data *e, Evas_Object *eo_obj, Efl_Canva break; } - if (evas_object_is_opaque(eo_current, current) || + if (evas_object_is_opaque(current) || ((current->func->has_opaque_rect) && (current->func->has_opaque_rect(eo_current, current, current->private_data)))) { @@ -2623,7 +2621,7 @@ _evas_render_cutout_add(Evas_Public_Data *evas, void *context, Evas_Coord cox = 0, coy = 0, cow = 0, coh = 0; if (evas_object_is_source_invisible(obj->object, obj)) return; - if (evas_object_is_opaque(obj->object, obj)) + if (evas_object_is_opaque(obj)) { cox = obj->cur->cache.clip.x; coy = obj->cur->cache.clip.y; @@ -2798,7 +2796,7 @@ _snapshot_redraw_update(Evas_Public_Data *evas, Evas_Object_Protected_Data *snap if (obj == snap) above = EINA_TRUE; continue; } - if (!obj->cur->snapshot || evas_object_is_opaque(obj->object, obj)) + if (!obj->cur->snapshot || evas_object_is_opaque(obj)) { const Eina_Rectangle cur = { obj->cur->cache.clip.x - x, obj->cur->cache.clip.y - y, @@ -2904,7 +2902,7 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *evas, OBJ_ARRAY_PUSH(&evas->temporary_objects, obj); if (above_top) continue; - if (obj->cur->snapshot && !evas_object_is_opaque(obj->object, obj)) + if (obj->cur->snapshot && !evas_object_is_opaque(obj)) continue; /* reset the background of the area if needed (using cutout and engine alpha flag to help) */ @@ -3013,7 +3011,7 @@ evas_render_updates_internal_loop(Evas *eo_e, Evas_Public_Data *evas, if (obj2->cur->snapshot) { if (above_top) continue; - if (!evas_object_is_opaque(obj2->object, obj2)) continue; + if (!evas_object_is_opaque(obj2)) continue; } #if 1 if ( @@ -3326,7 +3324,7 @@ evas_render_updates_internal(Evas *eo_e, if (UNLIKELY( (!obj->is_smart) && (!obj->clip.clipees) && - (evas_object_is_opaque(eo_obj, obj) || obj->cur->snapshot || + (evas_object_is_opaque(obj) || obj->cur->snapshot || ((obj->func->has_opaque_rect) && (obj->func->has_opaque_rect(eo_obj, obj, obj->private_data)))) && evas_object_is_visible(obj) && diff --git a/src/lib/evas/include/evas_inline.x b/src/lib/evas/include/evas_inline.x index b9989ee461..c5e7fa5323 100644 --- a/src/lib/evas/include/evas_inline.x +++ b/src/lib/evas/include/evas_inline.x @@ -98,7 +98,7 @@ evas_common_draw_context_cutouts_add(Cutout_Rects* rects, } static inline int -evas_object_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) +evas_object_is_opaque(Evas_Object_Protected_Data *obj) { if (obj->is_smart || obj->no_render) return 0; if (obj->cur->render_op == EVAS_RENDER_COPY) @@ -111,7 +111,7 @@ evas_object_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) (obj->clip.mask)) return 0; if (obj->func->is_opaque) - return obj->func->is_opaque(eo_obj, obj, obj->private_data); + return obj->func->is_opaque(obj->object, obj, obj->private_data); return 1; } return 0; |