summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2013-11-25 16:05:12 +0900
committerChunEon Park <hermet@hermet.pe.kr>2013-11-25 16:06:03 +0900
commit39599d1a26dc874d5fdb9c40edf3db77e44807a8 (patch)
tree9f62e1771904d49043d49bb3c85432bc0b20783a
parenteb48d55f3a7d64404f23a80b792b6b79a48d9ccb (diff)
evas - code refactoring.
merge duplicated(almost) functions to one.
-rw-r--r--src/lib/evas/canvas/evas_object_smart.c45
-rw-r--r--src/lib/evas/canvas/evas_render.c12
2 files changed, 15 insertions, 42 deletions
diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c
index 194ed3552f..6a49c4d2f2 100644
--- a/src/lib/evas/canvas/evas_object_smart.c
+++ b/src/lib/evas/canvas/evas_object_smart.c
@@ -1218,48 +1218,31 @@ _smart_changed(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
1218 eo_do(eo_obj, evas_obj_smart_need_recalculate_set(1)); 1218 eo_do(eo_obj, evas_obj_smart_need_recalculate_set(1));
1219} 1219}
1220 1220
1221static Eina_Bool 1221Eina_Bool
1222_smart_members_changed_check(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) 1222evas_object_smart_changed_get(Evas_Object *eo_obj)
1223{ 1223{
1224 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
1224 Evas_Object_Protected_Data *o2; 1225 Evas_Object_Protected_Data *o2;
1225 1226
1226 if (!evas_object_is_visible(eo_obj, obj) && 1227 if (!evas_object_is_visible(eo_obj, obj) &&
1227 !evas_object_was_visible(eo_obj, obj)) 1228 !evas_object_was_visible(eo_obj, obj))
1228 return EINA_FALSE; 1229 return EINA_FALSE;
1229 1230
1230 if (!obj->smart.smart) 1231 if (!obj->clip.clipees)
1231 { 1232 {
1232 if (obj->changed && !obj->clip.clipees) return EINA_TRUE; 1233 if (obj->changed)
1233 return EINA_FALSE; 1234 {
1234 } 1235 if (_evas_render_has_map(eo_obj, obj))
1235 if (_evas_render_has_map(eo_obj, obj)) 1236 {
1236 { 1237 if (((obj->changed_pchange) && (obj->changed_map)) ||
1237 if (((obj->changed_pchange) && (obj->changed_map)) || 1238 (obj->changed_color)) return EINA_TRUE;
1238 (obj->changed_color)) return EINA_TRUE; 1239 }
1239 } 1240 else if (!obj->is_smart) return EINA_TRUE;
1240 1241 }
1241 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), o2)
1242 if (_smart_members_changed_check(o2->object, o2)) return EINA_TRUE;
1243
1244 return EINA_FALSE;
1245}
1246
1247Eina_Bool
1248evas_object_smart_changed_get(Evas_Object *eo_obj)
1249{
1250 Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJ_CLASS);
1251 Evas_Object_Protected_Data *o2;
1252
1253 if (!obj->is_smart)
1254 {
1255 if (obj->changed && !obj->clip.clipees) return EINA_TRUE;
1256 else return EINA_FALSE;
1257 } 1242 }
1258 1243
1259 if (obj->changed_color) return EINA_TRUE;
1260
1261 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), o2) 1244 EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), o2)
1262 if (_smart_members_changed_check(o2->object, o2)) return EINA_TRUE; 1245 if (evas_object_smart_changed_get(o2->object)) return EINA_TRUE;
1263 1246
1264 return EINA_FALSE; 1247 return EINA_FALSE;
1265} 1248}
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index 18d196f350..6f901704de 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -1251,17 +1251,7 @@ evas_render_mapped(Evas_Public_Data *e, Evas_Object *eo_obj,
1251 changed = EINA_TRUE; 1251 changed = EINA_TRUE;
1252 } 1252 }
1253 1253
1254 if (!changed) 1254 if (!changed) changed = evas_object_smart_changed_get(eo_obj);
1255 {
1256 if (obj->is_smart)
1257 changed = evas_object_smart_changed_get(eo_obj);
1258 else if (obj->changed)
1259 {
1260 if (((obj->changed_pchange) && (obj->changed_map)) ||
1261 (obj->changed_color))
1262 changed = EINA_TRUE;
1263 }
1264 }
1265 1255
1266 /* mark the old map as invalid, so later we don't reuse it as a 1256 /* mark the old map as invalid, so later we don't reuse it as a
1267 * cache. */ 1257 * cache. */