summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-02-13 15:29:09 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-02-13 16:51:49 +0900
commit76244d89a75c0a465c3b4eb63d642b6ad14a3d74 (patch)
tree3c6a1055619f36f5e6aed8c410c3087bf421b790 /src/lib/evas/canvas
parent95d83e80406ddf48305cdbc91eecd340ecc4c6e1 (diff)
vpath file - add a keey property to know if obj should be kept around
if its a file downloading (to a tmp location) or a zip/tar/whatever file being extracted also to a tmp location and that tmp file needs to be removed after ...you need to keep the obj around to know when to delete the file. this makes the keeping optional and you query if the vpath obj is meant to be kept or not. if it's not it's safe to del immediately. this cuts down 1 obj per image obj/edje obj when generally unused. save some mem.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/canvas/efl_canvas_image.c8
-rw-r--r--src/lib/evas/canvas/evas_object_image.c7
2 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_image.c b/src/lib/evas/canvas/efl_canvas_image.c
index 3ebb2c92d9..b03808e005 100644
--- a/src/lib/evas/canvas/efl_canvas_image.c
+++ b/src/lib/evas/canvas/efl_canvas_image.c
@@ -70,6 +70,8 @@ _evas_image_file_set(Eo *eo_obj, const char *file, const char *key)
70 70
71 evas_object_async_block(obj); 71 evas_object_async_block(obj);
72 _evas_image_init_set(NULL, file, key, eo_obj, obj, o, &lo); 72 _evas_image_init_set(NULL, file, key, eo_obj, obj, o, &lo);
73 if (o->file_obj) efl_del(o->file_obj);
74 o->file_obj = NULL;
73 file2 = o->cur->u.file; 75 file2 = o->cur->u.file;
74 if (file2) 76 if (file2)
75 { 77 {
@@ -82,7 +84,11 @@ _evas_image_file_set(Eo *eo_obj, const char *file, const char *key)
82 o->engine_data = ENFN->image_load(ENDT, file2, o->cur->key, &o->load_error, &lo); 84 o->engine_data = ENFN->image_load(ENDT, file2, o->cur->key, &o->load_error, &lo);
83 o->buffer_data_set = EINA_FALSE; 85 o->buffer_data_set = EINA_FALSE;
84 _evas_image_done_set(eo_obj, obj, o); 86 _evas_image_done_set(eo_obj, obj, o);
85 87 if ((o->file_obj) && (!efl_vpath_file_keep_get(o->file_obj)))
88 {
89 efl_del(o->file_obj);
90 o->file_obj = NULL;
91 }
86 return EINA_TRUE; 92 return EINA_TRUE;
87} 93}
88 94
diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c
index fb878c030d..641e8a4e28 100644
--- a/src/lib/evas/canvas/evas_object_image.c
+++ b/src/lib/evas/canvas/evas_object_image.c
@@ -1312,6 +1312,8 @@ _evas_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Imag
1312 { 1312 {
1313 const char *file2 = o->cur->u.file; 1313 const char *file2 = o->cur->u.file;
1314 1314
1315 if (o->file_obj) efl_del(o->file_obj);
1316 o->file_obj = NULL;
1315 if (file2) 1317 if (file2)
1316 { 1318 {
1317 o->file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, file2); 1319 o->file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, file2);
@@ -1321,6 +1323,11 @@ _evas_image_load(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj, Evas_Imag
1321 file2 = efl_vpath_file_result_get(o->file_obj); 1323 file2 = efl_vpath_file_result_get(o->file_obj);
1322 } 1324 }
1323 o->engine_data = ENFN->image_load(ENDT, file2, o->cur->key, &o->load_error, &lo); 1325 o->engine_data = ENFN->image_load(ENDT, file2, o->cur->key, &o->load_error, &lo);
1326 if ((o->file_obj) && (!efl_vpath_file_keep_get(o->file_obj)))
1327 {
1328 efl_del(o->file_obj);
1329 o->file_obj = NULL;
1330 }
1324 } 1331 }
1325 1332
1326 if (o->engine_data) 1333 if (o->engine_data)