forked from enlightenment/efl
evas/render - refactoring about checking smart member changed.
move those code to the evas_object_smart.
This commit is contained in:
parent
e0b51e3a37
commit
5f4ae9abeb
|
@ -1125,6 +1125,50 @@ _smart_changed(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
|
|||
eo_do(eo_obj, evas_obj_smart_need_recalculate_set(1));
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_smart_members_changed_check(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
||||
{
|
||||
Evas_Object_Protected_Data *o2;
|
||||
|
||||
if (!evas_object_is_visible(eo_obj, obj) &&
|
||||
!evas_object_was_visible(eo_obj, obj))
|
||||
return EINA_FALSE;
|
||||
|
||||
if (!obj->smart.smart) return EINA_TRUE;
|
||||
if (_evas_render_has_map(eo_obj, obj))
|
||||
{
|
||||
if (((obj->changed_pchange) && (obj->changed_map)) ||
|
||||
(obj->changed_color)) return EINA_TRUE;
|
||||
}
|
||||
|
||||
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), o2)
|
||||
{
|
||||
if (!o2->changed) continue;
|
||||
if (_smart_members_changed_check(o2->object, o2)) return EINA_TRUE;
|
||||
}
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
evas_object_smart_changed_get(Evas_Object *eo_obj)
|
||||
{
|
||||
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
|
||||
Evas_Object_Protected_Data *o2;
|
||||
Eina_Bool changed = EINA_FALSE;
|
||||
|
||||
if (!obj->is_smart) return obj->changed;
|
||||
if (obj->changed_color) return EINA_TRUE;
|
||||
|
||||
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), o2)
|
||||
{
|
||||
if (!o2->changed) continue;
|
||||
changed = _smart_members_changed_check(o2->object, o2);
|
||||
if (changed) break;
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
void
|
||||
evas_object_smart_del(Evas_Object *eo_obj)
|
||||
{
|
||||
|
|
|
@ -975,28 +975,6 @@ _evas_render_can_use_overlay(Evas_Public_Data *e, Evas_Object *eo_obj)
|
|||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
_smart_members_changed_check(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
||||
{
|
||||
Evas_Object_Protected_Data *o2;
|
||||
|
||||
if (!evas_object_is_visible(eo_obj, obj) &&
|
||||
!evas_object_was_visible(eo_obj, obj))
|
||||
return EINA_FALSE;
|
||||
|
||||
if (!obj->smart.smart) return EINA_TRUE;
|
||||
if (obj->changed_color) return EINA_TRUE;
|
||||
if ((obj->changed_pchange) && (obj->changed_map)) return EINA_TRUE;
|
||||
|
||||
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), o2)
|
||||
{
|
||||
if (!o2->changed) continue;
|
||||
if (_smart_members_changed_check(o2->object, o2)) return EINA_TRUE;
|
||||
}
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
Eina_Bool
|
||||
evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
|
||||
Evas_Object_Protected_Data *obj, void *context,
|
||||
|
@ -1013,6 +991,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
|
|||
Eina_Bool clean_them = EINA_FALSE;
|
||||
Eina_Bool proxy_src_clip = EINA_TRUE;
|
||||
|
||||
//Don't Render if the source is invisible.
|
||||
if (!proxy_render_data)
|
||||
{
|
||||
if ((evas_object_is_source_invisible(eo_obj, obj)))
|
||||
|
@ -1122,18 +1101,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
|
|||
if (!changed)
|
||||
{
|
||||
if (obj->is_smart)
|
||||
{
|
||||
Evas_Object_Protected_Data *o2;
|
||||
|
||||
EINA_INLIST_FOREACH(
|
||||
evas_object_smart_members_get_direct(eo_obj), o2)
|
||||
{
|
||||
if (!o2->changed) continue;
|
||||
changed = _smart_members_changed_check(o2->object, o2);
|
||||
if (changed) break;
|
||||
}
|
||||
if (obj->changed_color) changed = EINA_TRUE;
|
||||
}
|
||||
changed = evas_object_smart_changed_get(eo_obj);
|
||||
else if (obj->changed)
|
||||
{
|
||||
if (((obj->changed_pchange) && (obj->changed_map)) ||
|
||||
|
|
|
@ -991,6 +991,7 @@ void _evas_object_smart_members_all_del(Evas_Object *obj);
|
|||
void evas_call_smarts_calculate(Evas *e);
|
||||
void evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
|
||||
void evas_object_smart_need_bounding_box_update(Evas_Object *obj);
|
||||
Eina_Bool evas_object_smart_changed_get(Evas_Object *eo_obj);
|
||||
void *evas_mem_calloc(int size);
|
||||
void _evas_post_event_callback_call(Evas *e, Evas_Public_Data* e_pd);
|
||||
void _evas_post_event_callback_free(Evas *e);
|
||||
|
|
Loading…
Reference in New Issue