forked from enlightenment/efl
evas_inline: Clean up evas_object_was_visible 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 Reviewers: raster, cedric, zmike Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T7230 Differential Revision: https://phab.enlightenment.org/D9045
This commit is contained in:
parent
194d769175
commit
ef23de1ea4
|
@ -643,7 +643,7 @@ _efl_canvas_vg_object_render_pre(Evas_Object *eo_obj,
|
||||||
/* now figure what changed and add draw rects */
|
/* now figure what changed and add draw rects */
|
||||||
/* if it just became visible or invisible */
|
/* if it just became visible or invisible */
|
||||||
is_v = evas_object_is_visible(eo_obj, obj);
|
is_v = evas_object_is_visible(eo_obj, obj);
|
||||||
was_v = evas_object_was_visible(eo_obj,obj);
|
was_v = evas_object_was_visible(obj);
|
||||||
if (!(is_v | was_v)) goto done;
|
if (!(is_v | was_v)) goto done;
|
||||||
|
|
||||||
if (pd->changed)
|
if (pd->changed)
|
||||||
|
|
|
@ -2294,7 +2294,7 @@ evas_object_image_render_pre(Evas_Object *eo_obj,
|
||||||
/* now figure what changed and add draw rects */
|
/* now figure what changed and add draw rects */
|
||||||
/* if it just became visible or invisible */
|
/* if it just became visible or invisible */
|
||||||
is_v = evas_object_is_visible(eo_obj, obj);
|
is_v = evas_object_is_visible(eo_obj, obj);
|
||||||
was_v = evas_object_was_visible(eo_obj, obj);
|
was_v = evas_object_was_visible(obj);
|
||||||
if (is_v != was_v)
|
if (is_v != was_v)
|
||||||
{
|
{
|
||||||
evas_object_render_pre_visible_change(&e->clip_changes, eo_obj, is_v, was_v);
|
evas_object_render_pre_visible_change(&e->clip_changes, eo_obj, is_v, was_v);
|
||||||
|
|
|
@ -275,7 +275,7 @@ evas_object_line_render_pre(Evas_Object *eo_obj,
|
||||||
/* now figure what changed and add draw rects */
|
/* now figure what changed and add draw rects */
|
||||||
/* if it just became visible or invisible */
|
/* if it just became visible or invisible */
|
||||||
is_v = evas_object_is_visible(eo_obj, obj);
|
is_v = evas_object_is_visible(eo_obj, obj);
|
||||||
was_v = evas_object_was_visible(eo_obj, obj);
|
was_v = evas_object_was_visible(obj);
|
||||||
if (is_v != was_v)
|
if (is_v != was_v)
|
||||||
{
|
{
|
||||||
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, eo_obj, is_v, was_v);
|
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, eo_obj, is_v, was_v);
|
||||||
|
|
|
@ -330,7 +330,7 @@ evas_object_polygon_render_pre(Evas_Object *eo_obj,
|
||||||
/* now figure what changed and add draw rects */
|
/* now figure what changed and add draw rects */
|
||||||
/* if it just became visible or invisible */
|
/* if it just became visible or invisible */
|
||||||
is_v = evas_object_is_visible(eo_obj, obj);
|
is_v = evas_object_is_visible(eo_obj, obj);
|
||||||
was_v = evas_object_was_visible(eo_obj, obj);
|
was_v = evas_object_was_visible(obj);
|
||||||
if (is_v != was_v)
|
if (is_v != was_v)
|
||||||
{
|
{
|
||||||
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, eo_obj, is_v, was_v);
|
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, eo_obj, is_v, was_v);
|
||||||
|
|
|
@ -159,7 +159,7 @@ evas_object_rectangle_render_pre(Evas_Object *eo_obj,
|
||||||
/* now figure what changed and add draw rects */
|
/* now figure what changed and add draw rects */
|
||||||
/* if it just became visible or invisible */
|
/* if it just became visible or invisible */
|
||||||
is_v = evas_object_is_visible(eo_obj, obj);
|
is_v = evas_object_is_visible(eo_obj, obj);
|
||||||
was_v = evas_object_was_visible(eo_obj,obj);
|
was_v = evas_object_was_visible(obj);
|
||||||
if (!(is_v | was_v)) goto done;
|
if (!(is_v | was_v)) goto done;
|
||||||
if (is_v != was_v)
|
if (is_v != was_v)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2078,7 +2078,7 @@ evas_object_text_render_pre(Evas_Object *eo_obj,
|
||||||
/* now figure what changed and add draw rects
|
/* now figure what changed and add draw rects
|
||||||
if it just became visible or invisible */
|
if it just became visible or invisible */
|
||||||
is_v = evas_object_is_visible(eo_obj, obj);
|
is_v = evas_object_is_visible(eo_obj, obj);
|
||||||
was_v = evas_object_was_visible(eo_obj, obj);
|
was_v = evas_object_was_visible(obj);
|
||||||
if (is_v != was_v)
|
if (is_v != was_v)
|
||||||
{
|
{
|
||||||
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes,
|
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes,
|
||||||
|
|
|
@ -15042,7 +15042,7 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
|
||||||
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
|
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
|
||||||
eo_obj, obj);
|
eo_obj, obj);
|
||||||
is_v = evas_object_is_visible(eo_obj, obj);
|
is_v = evas_object_is_visible(eo_obj, obj);
|
||||||
was_v = evas_object_was_visible(eo_obj, obj);
|
was_v = evas_object_was_visible(obj);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
if (o->changed)
|
if (o->changed)
|
||||||
|
@ -15052,7 +15052,7 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
|
||||||
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
|
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
|
||||||
eo_obj, obj);
|
eo_obj, obj);
|
||||||
is_v = evas_object_is_visible(eo_obj, obj);
|
is_v = evas_object_is_visible(eo_obj, obj);
|
||||||
was_v = evas_object_was_visible(eo_obj, obj);
|
was_v = evas_object_was_visible(obj);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15062,13 +15062,13 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
|
||||||
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
|
evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
|
||||||
eo_obj, obj);
|
eo_obj, obj);
|
||||||
is_v = evas_object_is_visible(eo_obj, obj);
|
is_v = evas_object_is_visible(eo_obj, obj);
|
||||||
was_v = evas_object_was_visible(eo_obj, obj);
|
was_v = evas_object_was_visible(obj);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
/* now figure what changed and add draw rects */
|
/* now figure what changed and add draw rects */
|
||||||
/* if it just became visible or invisible */
|
/* if it just became visible or invisible */
|
||||||
is_v = evas_object_is_visible(eo_obj, obj);
|
is_v = evas_object_is_visible(eo_obj, obj);
|
||||||
was_v = evas_object_was_visible(eo_obj, obj);
|
was_v = evas_object_was_visible(obj);
|
||||||
if (is_v != was_v)
|
if (is_v != was_v)
|
||||||
{
|
{
|
||||||
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes,
|
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes,
|
||||||
|
|
|
@ -682,7 +682,7 @@ evas_object_textgrid_render_pre(Evas_Object *eo_obj,
|
||||||
/* now figure what changed and add draw rects */
|
/* now figure what changed and add draw rects */
|
||||||
/* if it just became visible or invisible */
|
/* if it just became visible or invisible */
|
||||||
is_v = evas_object_is_visible(eo_obj, obj);
|
is_v = evas_object_is_visible(eo_obj, obj);
|
||||||
was_v = evas_object_was_visible(eo_obj, obj);
|
was_v = evas_object_was_visible(obj);
|
||||||
if (is_v != was_v)
|
if (is_v != was_v)
|
||||||
{
|
{
|
||||||
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, eo_obj, is_v, was_v);
|
evas_object_render_pre_visible_change(&obj->layer->evas->clip_changes, eo_obj, is_v, was_v);
|
||||||
|
|
|
@ -289,7 +289,7 @@ static Eina_Bool
|
||||||
_evas_render_is_relevant(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
_evas_render_is_relevant(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
||||||
{
|
{
|
||||||
return ((evas_object_is_visible(eo_obj, obj) && (!obj->cur->have_clipees)) ||
|
return ((evas_object_is_visible(eo_obj, obj) && (!obj->cur->have_clipees)) ||
|
||||||
(evas_object_was_visible(eo_obj, obj) && (!obj->prev->have_clipees)));
|
(evas_object_was_visible(obj) && (!obj->prev->have_clipees)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -791,7 +791,7 @@ _evas_render_phase1_object_mapped(Phase1_Context *p1ctx,
|
||||||
(!obj->clip.clipees) &&
|
(!obj->clip.clipees) &&
|
||||||
((evas_object_is_visible(eo_obj, obj) &&
|
((evas_object_is_visible(eo_obj, obj) &&
|
||||||
(!obj->cur->have_clipees)) ||
|
(!obj->cur->have_clipees)) ||
|
||||||
(evas_object_was_visible(eo_obj, obj) &&
|
(evas_object_was_visible(obj) &&
|
||||||
(!obj->prev->have_clipees)))))
|
(!obj->prev->have_clipees)))))
|
||||||
return;
|
return;
|
||||||
OBJ_ARRAY_PUSH(p1ctx->render_objects, obj);
|
OBJ_ARRAY_PUSH(p1ctx->render_objects, obj);
|
||||||
|
@ -943,7 +943,7 @@ _evas_render_phase1_object_changed_normal(Phase1_Context *p1ctx,
|
||||||
/* It goes to be hidden. Prev caching should be replaced
|
/* It goes to be hidden. Prev caching should be replaced
|
||||||
by the current (hidden) state. */
|
by the current (hidden) state. */
|
||||||
if (evas_object_is_visible(eo_obj, obj) !=
|
if (evas_object_is_visible(eo_obj, obj) !=
|
||||||
evas_object_was_visible(eo_obj, obj))
|
evas_object_was_visible(obj))
|
||||||
evas_object_cur_prev(obj);
|
evas_object_cur_prev(obj);
|
||||||
RD(level, " skip - not smart, not active or clippees or not relevant\n");
|
RD(level, " skip - not smart, not active or clippees or not relevant\n");
|
||||||
}
|
}
|
||||||
|
@ -1182,11 +1182,11 @@ _evas_render_phase1_object_process(Phase1_Context *p1ctx,
|
||||||
RD(level, " not changed... [%i] -> (%i %i %p %i) [%i]\n",
|
RD(level, " not changed... [%i] -> (%i %i %p %i) [%i]\n",
|
||||||
evas_object_is_visible(eo_obj, obj),
|
evas_object_is_visible(eo_obj, obj),
|
||||||
obj->cur->visible, obj->cur->cache.clip.visible, obj->smart.smart,
|
obj->cur->visible, obj->cur->cache.clip.visible, obj->smart.smart,
|
||||||
obj->cur->cache.clip.a, evas_object_was_visible(eo_obj, obj));
|
obj->cur->cache.clip.a, evas_object_was_visible(obj));
|
||||||
if ((!obj->clip.clipees) &&
|
if ((!obj->clip.clipees) &&
|
||||||
(EINA_LIKELY(obj->delete_me == 0)) &&
|
(EINA_LIKELY(obj->delete_me == 0)) &&
|
||||||
(_evas_render_can_render(eo_obj, obj) ||
|
(_evas_render_can_render(eo_obj, obj) ||
|
||||||
(evas_object_was_visible(eo_obj, obj) &&
|
(evas_object_was_visible(obj) &&
|
||||||
(!obj->prev->have_clipees))))
|
(!obj->prev->have_clipees))))
|
||||||
{
|
{
|
||||||
if (obj->is_smart)
|
if (obj->is_smart)
|
||||||
|
@ -1295,7 +1295,7 @@ _evas_render_check_pending_objects(Eina_Array *pending_objects, Evas *eo_e EINA_
|
||||||
else
|
else
|
||||||
if ((is_active) && (obj->restack) && (!obj->clip.clipees) &&
|
if ((is_active) && (obj->restack) && (!obj->clip.clipees) &&
|
||||||
(_evas_render_can_render(eo_obj, obj) ||
|
(_evas_render_can_render(eo_obj, obj) ||
|
||||||
(evas_object_was_visible(eo_obj, obj) && (!obj->prev->have_clipees))))
|
(evas_object_was_visible(obj) && (!obj->prev->have_clipees))))
|
||||||
{
|
{
|
||||||
if (!obj->render_pre && !obj->rect_del && !obj->delete_me)
|
if (!obj->render_pre && !obj->rect_del && !obj->delete_me)
|
||||||
ok = EINA_TRUE;
|
ok = EINA_TRUE;
|
||||||
|
@ -1303,7 +1303,7 @@ _evas_render_check_pending_objects(Eina_Array *pending_objects, Evas *eo_e EINA_
|
||||||
else
|
else
|
||||||
if (is_active && (!obj->clip.clipees) &&
|
if (is_active && (!obj->clip.clipees) &&
|
||||||
(_evas_render_can_render(eo_obj, obj) ||
|
(_evas_render_can_render(eo_obj, obj) ||
|
||||||
(evas_object_was_visible(eo_obj, obj) && (!obj->prev->have_clipees))))
|
(evas_object_was_visible(obj) && (!obj->prev->have_clipees))))
|
||||||
{
|
{
|
||||||
if (obj->render_pre || obj->rect_del) ok = EINA_TRUE;
|
if (obj->render_pre || obj->rect_del) ok = EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1311,7 +1311,7 @@ _evas_render_check_pending_objects(Eina_Array *pending_objects, Evas *eo_e EINA_
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((!obj->clip.clipees) && (obj->delete_me == 0) &&
|
if ((!obj->clip.clipees) && (obj->delete_me == 0) &&
|
||||||
(!obj->cur->have_clipees || (evas_object_was_visible(eo_obj, obj) && (!obj->prev->have_clipees)))
|
(!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(eo_obj, obj))
|
||||||
{
|
{
|
||||||
if (obj->rect_del || obj->is_smart) ok = EINA_TRUE;
|
if (obj->rect_del || obj->is_smart) ok = EINA_TRUE;
|
||||||
|
|
|
@ -51,7 +51,7 @@ _evas_object_callback_has_by_type(Evas_Object_Protected_Data *obj, Evas_Callback
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
evas_object_was_visible(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
evas_object_was_visible(Evas_Object_Protected_Data *obj)
|
||||||
{
|
{
|
||||||
if (EINA_UNLIKELY(!obj->prev)) return 0;
|
if (EINA_UNLIKELY(!obj->prev)) return 0;
|
||||||
if ((obj->prev->visible) && (!obj->no_render) &&
|
if ((obj->prev->visible) && (!obj->no_render) &&
|
||||||
|
@ -60,7 +60,7 @@ evas_object_was_visible(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
||||||
|| obj->prev->render_op != EVAS_RENDER_BLEND))
|
|| obj->prev->render_op != EVAS_RENDER_BLEND))
|
||||||
{
|
{
|
||||||
if (obj->func->was_visible)
|
if (obj->func->was_visible)
|
||||||
return obj->func->was_visible(eo_obj);
|
return obj->func->was_visible(obj->object);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -240,7 +240,7 @@ evas_object_is_in_output_rect(Evas_Object *eo_obj EINA_UNUSED, Evas_Object_Prote
|
||||||
static inline int
|
static inline int
|
||||||
evas_object_is_active(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
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(eo_obj, obj))
|
if (evas_object_is_visible(eo_obj, obj) || evas_object_was_visible(obj))
|
||||||
{
|
{
|
||||||
Evas_Public_Data *e = obj->layer->evas;
|
Evas_Public_Data *e = obj->layer->evas;
|
||||||
int fx, fy;
|
int fx, fy;
|
||||||
|
|
Loading…
Reference in New Issue