diff options
author | Cedric BAIL <cedric@osg.samsung.com> | 2014-10-29 06:15:11 +0100 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2014-10-29 06:15:11 +0100 |
commit | c3b4a573a212a3db3ba496920e44688afe8f28f5 (patch) | |
tree | 8fde0c4966fd1529c4e7576396d2c5abcf6d2c9d /src/lib | |
parent | eb11a157ec0c0bdf8ae9092767407c7e3172948b (diff) |
evas: fix increased memory usage in Evas.
Eina_Cow does memory comparison during standby time. So in expedite as we don't
have any standby time, we end up allocating some vast amount of memory that
will never be compared. It is way simpler to compare that the data are not
going to change before hand. It should also reduce the CPU consumed during
idle time.
This patch save about 1MB of data at peak time in expedite.
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/evas/canvas/evas_object_image.c | 11 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_main.c | 15 |
2 files changed, 18 insertions, 8 deletions
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 6a1b9e98ff..05e5fb8e55 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c | |||
@@ -280,11 +280,16 @@ Eina_Cow *evas_object_image_state_cow = NULL; | |||
280 | static void | 280 | static void |
281 | _evas_object_image_cleanup(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o) | 281 | _evas_object_image_cleanup(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Image_Data *o) |
282 | { | 282 | { |
283 | EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) | 283 | /* Eina_Cow doesn't know if the resulting memory has changed, better check |
284 | before we change it */ | ||
285 | if (o->cur->opaque_valid) | ||
284 | { | 286 | { |
285 | state_write->opaque_valid = 0; | 287 | EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) |
288 | { | ||
289 | state_write->opaque_valid = 0; | ||
290 | } | ||
291 | EINA_COW_IMAGE_STATE_WRITE_END(o, state_write); | ||
286 | } | 292 | } |
287 | EINA_COW_IMAGE_STATE_WRITE_END(o, state_write); | ||
288 | 293 | ||
289 | if ((o->preloading) && (o->engine_data)) | 294 | if ((o->preloading) && (o->engine_data)) |
290 | { | 295 | { |
diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index e5317e2598..fded1ceee6 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c | |||
@@ -687,13 +687,18 @@ _evas_object_eo_base_destructor(Eo *eo_obj, Evas_Object_Protected_Data *obj) | |||
687 | eo_do(proxy, evas_obj_text_filter_source_set(NULL, eo_obj)); | 687 | eo_do(proxy, evas_obj_text_filter_source_set(NULL, eo_obj)); |
688 | } | 688 | } |
689 | 689 | ||
690 | EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy, | 690 | /* Eina_Cow has no way to know if we are going to really change something |
691 | Evas_Object_Proxy_Data, proxy_src) | 691 | or not. So before calling the cow, let's check if we want to do something */ |
692 | if (obj->proxy->proxy_textures) | ||
692 | { | 693 | { |
693 | EINA_LIST_FREE(proxy_src->proxy_textures, texture) | 694 | EINA_COW_WRITE_BEGIN(evas_object_proxy_cow, obj->proxy, |
694 | eo_do(texture, evas_3d_texture_source_set(NULL)); | 695 | Evas_Object_Proxy_Data, proxy_src) |
696 | { | ||
697 | EINA_LIST_FREE(proxy_src->proxy_textures, texture) | ||
698 | eo_do(texture, evas_3d_texture_source_set(NULL)); | ||
699 | } | ||
700 | EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_src); | ||
695 | } | 701 | } |
696 | EINA_COW_WRITE_END(evas_object_proxy_cow, obj->proxy, proxy_src); | ||
697 | 702 | ||
698 | if (obj->cur->clipper) evas_object_clip_unset(eo_obj); | 703 | if (obj->cur->clipper) evas_object_clip_unset(eo_obj); |
699 | evas_object_map_set(eo_obj, NULL); | 704 | evas_object_map_set(eo_obj, NULL); |