summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2019-05-29 15:37:07 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-05-29 15:37:36 -0400
commit70ea7ba9daa152796f94aa6b49857eb7ee4e09c6 (patch)
treeb27379cb44b6139d371b70661abc3dd3b66006c5
parentc10a4dcd18ddcd306f06d99116658605ef82cc6b (diff)
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.c2
-rw-r--r--src/lib/evas/canvas/evas_object_image.c8
-rw-r--r--src/lib/evas/canvas/evas_object_rectangle.c2
-rw-r--r--src/lib/evas/canvas/evas_render.c20
-rw-r--r--src/lib/evas/include/evas_inline.x4
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,
702 /* area so if there were updates for it they get wiped. don't do it if we */ 702 /* area so if there were updates for it they get wiped. don't do it if we */
703 /* arent fully opaque and we are visible */ 703 /* arent fully opaque and we are visible */
704 if (evas_object_is_visible(obj) && 704 if (evas_object_is_visible(obj) &&
705 evas_object_is_opaque(eo_obj, obj) && 705 evas_object_is_opaque(obj) &&
706 (!obj->clip.clipees)) 706 (!obj->clip.clipees))
707 { 707 {
708 Evas_Coord x, y, w, h; 708 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,
2422 Eina_Rectangle *rr; 2422 Eina_Rectangle *rr;
2423 2423
2424 if ((!o->cur->has_alpha) && 2424 if ((!o->cur->has_alpha) &&
2425 (evas_object_is_opaque(eo_obj, obj)) && 2425 (evas_object_is_opaque(obj)) &&
2426 (obj->cur->color.a == 255)) 2426 (obj->cur->color.a == 255))
2427 { 2427 {
2428 Evas_Coord x, y, w, h; 2428 Evas_Coord x, y, w, h;
@@ -2514,7 +2514,7 @@ evas_object_image_render_pre(Evas_Object *eo_obj,
2514 Eina_Rectangle *rr; 2514 Eina_Rectangle *rr;
2515 2515
2516 if ((!o->cur->has_alpha) && 2516 if ((!o->cur->has_alpha) &&
2517 (evas_object_is_opaque(eo_obj, obj)) && 2517 (evas_object_is_opaque(obj)) &&
2518 (obj->cur->color.a == 255)) 2518 (obj->cur->color.a == 255))
2519 { 2519 {
2520 Evas_Coord x, y, w, h; 2520 Evas_Coord x, y, w, h;
@@ -2614,7 +2614,7 @@ evas_object_image_render_pre(Evas_Object *eo_obj,
2614 /* it obviously didn't change - add a NO obscure - this "unupdates" this */ 2614 /* it obviously didn't change - add a NO obscure - this "unupdates" this */
2615 /* area so if there were updates for it they get wiped. don't do it if we */ 2615 /* area so if there were updates for it they get wiped. don't do it if we */
2616 /* aren't fully opaque and we are visible */ 2616 /* aren't fully opaque and we are visible */
2617 if (evas_object_is_opaque(eo_obj, obj)) 2617 if (evas_object_is_opaque(obj))
2618 { 2618 {
2619 Evas_Coord x, y, w, h; 2619 Evas_Coord x, y, w, h;
2620 2620
@@ -2753,7 +2753,7 @@ evas_object_image_is_opaque(Evas_Object *eo_obj EINA_UNUSED,
2753 Evas_Object_Protected_Data *cur_source = efl_data_scope_get(o->cur->source, EFL_CANVAS_OBJECT_CLASS); 2753 Evas_Object_Protected_Data *cur_source = efl_data_scope_get(o->cur->source, EFL_CANVAS_OBJECT_CLASS);
2754 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) 2754 EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write)
2755 { 2755 {
2756 state_write->opaque = evas_object_is_opaque(o->cur->source, cur_source); 2756 state_write->opaque = evas_object_is_opaque(cur_source);
2757 } 2757 }
2758 EINA_COW_IMAGE_STATE_WRITE_END(o, state_write); 2758 EINA_COW_IMAGE_STATE_WRITE_END(o, state_write);
2759 return o->cur->opaque; /* FIXME: Should go poke at the object */ 2759 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,
204 /* area so if there were updates for it they get wiped. don't do it if we */ 204 /* area so if there were updates for it they get wiped. don't do it if we */
205 /* arent fully opaque and we are visible */ 205 /* arent fully opaque and we are visible */
206 if (evas_object_is_visible(obj) && 206 if (evas_object_is_visible(obj) &&
207 evas_object_is_opaque(eo_obj, obj) && 207 evas_object_is_opaque(obj) &&
208 (!obj->clip.clipees)) 208 (!obj->clip.clipees))
209 { 209 {
210 Evas_Coord x, y, w, h; 210 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,
521 } 521 }
522 else if (evas_object_is_visible(obj) && 522 else if (evas_object_is_visible(obj) &&
523 ((obj->rect_del) || 523 ((obj->rect_del) ||
524 (evas_object_is_opaque(eo_obj, obj))) && 524 (evas_object_is_opaque(obj))) &&
525 (!evas_object_is_source_invisible(eo_obj, obj))) 525 (!evas_object_is_source_invisible(eo_obj, obj)))
526 { 526 {
527 RD(0, " rect del\n"); 527 RD(0, " rect del\n");
@@ -1030,9 +1030,7 @@ _evas_render_phase1_object_no_changed_normal(Phase1_Context *p1ctx,
1030#endif 1030#endif
1031 ) 1031 )
1032{ 1032{
1033 Evas_Object *eo_obj = obj->object; 1033 if (evas_object_is_opaque(obj) &&
1034
1035 if (evas_object_is_opaque(eo_obj, obj) &&
1036 evas_object_is_visible(obj)) 1034 evas_object_is_visible(obj))
1037 { 1035 {
1038 RD(level, " opaque + visible\n"); 1036 RD(level, " opaque + visible\n");
@@ -1310,7 +1308,7 @@ _evas_render_check_pending_objects(Eina_Array *pending_objects, Evas *eo_e EINA_
1310 { 1308 {
1311 if ((!obj->clip.clipees) && (obj->delete_me == 0) && 1309 if ((!obj->clip.clipees) && (obj->delete_me == 0) &&
1312 (!obj->cur->have_clipees || (evas_object_was_visible(obj) && (!obj->prev->have_clipees))) 1310 (!obj->cur->have_clipees || (evas_object_was_visible(obj) && (!obj->prev->have_clipees)))
1313 && evas_object_is_opaque(eo_obj, obj) && evas_object_is_visible(obj)) 1311 && evas_object_is_opaque(obj) && evas_object_is_visible(obj))
1314 { 1312 {
1315 if (obj->rect_del || obj->is_smart) ok = EINA_TRUE; 1313 if (obj->rect_del || obj->is_smart) ok = EINA_TRUE;
1316 } 1314 }
@@ -1515,7 +1513,7 @@ _evas_render_can_use_overlay(Evas_Public_Data *e, Evas_Object *eo_obj, Efl_Canva
1515 break; 1513 break;
1516 } 1514 }
1517 1515
1518 if (evas_object_is_opaque(eo_current, current) || 1516 if (evas_object_is_opaque(current) ||
1519 ((current->func->has_opaque_rect) && 1517 ((current->func->has_opaque_rect) &&
1520 (current->func->has_opaque_rect(eo_current, current, current->private_data)))) 1518 (current->func->has_opaque_rect(eo_current, current, current->private_data))))
1521 { 1519 {
@@ -2623,7 +2621,7 @@ _evas_render_cutout_add(Evas_Public_Data *evas, void *context,
2623 Evas_Coord cox = 0, coy = 0, cow = 0, coh = 0; 2621 Evas_Coord cox = 0, coy = 0, cow = 0, coh = 0;
2624 2622
2625 if (evas_object_is_source_invisible(obj->object, obj)) return; 2623 if (evas_object_is_source_invisible(obj->object, obj)) return;
2626 if (evas_object_is_opaque(obj->object, obj)) 2624 if (evas_object_is_opaque(obj))
2627 { 2625 {
2628 cox = obj->cur->cache.clip.x; 2626 cox = obj->cur->cache.clip.x;
2629 coy = obj->cur->cache.clip.y; 2627 coy = obj->cur->cache.clip.y;
@@ -2798,7 +2796,7 @@ _snapshot_redraw_update(Evas_Public_Data *evas, Evas_Object_Protected_Data *snap
2798 if (obj == snap) above = EINA_TRUE; 2796 if (obj == snap) above = EINA_TRUE;
2799 continue; 2797 continue;
2800 } 2798 }
2801 if (!obj->cur->snapshot || evas_object_is_opaque(obj->object, obj)) 2799 if (!obj->cur->snapshot || evas_object_is_opaque(obj))
2802 { 2800 {
2803 const Eina_Rectangle cur = { 2801 const Eina_Rectangle cur = {
2804 obj->cur->cache.clip.x - x, obj->cur->cache.clip.y - y, 2802 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,
2904 OBJ_ARRAY_PUSH(&evas->temporary_objects, obj); 2902 OBJ_ARRAY_PUSH(&evas->temporary_objects, obj);
2905 2903
2906 if (above_top) continue; 2904 if (above_top) continue;
2907 if (obj->cur->snapshot && !evas_object_is_opaque(obj->object, obj)) 2905 if (obj->cur->snapshot && !evas_object_is_opaque(obj))
2908 continue; 2906 continue;
2909 2907
2910 /* reset the background of the area if needed (using cutout and engine alpha flag to help) */ 2908 /* 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,
3013 if (obj2->cur->snapshot) 3011 if (obj2->cur->snapshot)
3014 { 3012 {
3015 if (above_top) continue; 3013 if (above_top) continue;
3016 if (!evas_object_is_opaque(obj2->object, obj2)) continue; 3014 if (!evas_object_is_opaque(obj2)) continue;
3017 } 3015 }
3018#if 1 3016#if 1
3019 if ( 3017 if (
@@ -3326,7 +3324,7 @@ evas_render_updates_internal(Evas *eo_e,
3326 if (UNLIKELY( 3324 if (UNLIKELY(
3327 (!obj->is_smart) && 3325 (!obj->is_smart) &&
3328 (!obj->clip.clipees) && 3326 (!obj->clip.clipees) &&
3329 (evas_object_is_opaque(eo_obj, obj) || obj->cur->snapshot || 3327 (evas_object_is_opaque(obj) || obj->cur->snapshot ||
3330 ((obj->func->has_opaque_rect) && 3328 ((obj->func->has_opaque_rect) &&
3331 (obj->func->has_opaque_rect(eo_obj, obj, obj->private_data)))) && 3329 (obj->func->has_opaque_rect(eo_obj, obj, obj->private_data)))) &&
3332 evas_object_is_visible(obj) && 3330 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,
98} 98}
99 99
100static inline int 100static inline int
101evas_object_is_opaque(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) 101evas_object_is_opaque(Evas_Object_Protected_Data *obj)
102{ 102{
103 if (obj->is_smart || obj->no_render) return 0; 103 if (obj->is_smart || obj->no_render) return 0;
104 if (obj->cur->render_op == EVAS_RENDER_COPY) 104 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)
111 (obj->clip.mask)) 111 (obj->clip.mask))
112 return 0; 112 return 0;
113 if (obj->func->is_opaque) 113 if (obj->func->is_opaque)
114 return obj->func->is_opaque(eo_obj, obj, obj->private_data); 114 return obj->func->is_opaque(obj->object, obj, obj->private_data);
115 return 1; 115 return 1;
116 } 116 }
117 return 0; 117 return 0;