summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-02-14 08:33:43 -0500
committerMike Blumenkrantz <zmike@samsung.com>2020-02-14 08:33:43 -0500
commitacee4e1db53e00e145d845fe99a86b4dffe753f6 (patch)
tree4c86c7e885ebedd8ce1454c66edd252097a82770 /src/lib/evas
parentc37e545a03d9bb4e66e657e37af89e5241e3c9b6 (diff)
evas: restore codepath for loading images from files with skip_head set
Summary: this was never handled during refactoring because it had already been removed from the tree by that point fix T8378 Depends on D11339 Reviewers: raster Reviewed By: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8378 Differential Revision: https://phab.enlightenment.org/D11340
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/canvas/efl_canvas_image.c21
-rw-r--r--src/lib/evas/canvas/evas_image_legacy.c8
-rw-r--r--src/lib/evas/canvas/evas_image_private.h2
3 files changed, 21 insertions, 10 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_image.c b/src/lib/evas/canvas/efl_canvas_image.c
index 1bdd5329ec..679fbdca05 100644
--- a/src/lib/evas/canvas/efl_canvas_image.c
+++ b/src/lib/evas/canvas/efl_canvas_image.c
@@ -20,18 +20,18 @@ _evas_image_file_unload(Eo *eo_obj)
20 o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_NONE; 20 o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_NONE;
21} 21}
22Eina_Bool 22Eina_Bool
23_evas_image_file_load(Eo *eo_obj) 23_evas_image_file_load(Eo *eo_obj, Evas_Image_Data *o)
24{ 24{
25 Evas_Object_Protected_Data *obj; 25 Evas_Object_Protected_Data *obj;
26 Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
27 Evas_Image_Load_Opts lo; 26 Evas_Image_Load_Opts lo;
28 const Eina_File *f = efl_file_mmap_get(eo_obj); 27 const Eina_File *f = efl_file_mmap_get(eo_obj);
29 const char *key = efl_file_key_get(eo_obj); 28 const char *key = efl_file_key_get(eo_obj);
30 int load_error; 29 int load_error;
31 30
32 EINA_SAFETY_ON_NULL_RETURN_VAL(f, EINA_FALSE); 31 if (!o->skip_head)
32 EINA_SAFETY_ON_NULL_RETURN_VAL(f, EINA_FALSE);
33 33
34 if (o->cur->f == f) 34 if (f && (o->cur->f == f))
35 { 35 {
36 if ((!o->cur->key) && (!key)) 36 if ((!o->cur->key) && (!key))
37 return EINA_TRUE; 37 return EINA_TRUE;
@@ -42,7 +42,10 @@ _evas_image_file_load(Eo *eo_obj)
42 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 42 obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
43 evas_object_async_block(obj); 43 evas_object_async_block(obj);
44 _evas_image_init_set(f, key, eo_obj, obj, o, &lo); 44 _evas_image_init_set(f, key, eo_obj, obj, o, &lo);
45 o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &load_error, &lo); 45 if (f)
46 o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &load_error, &lo);
47 else
48 o->engine_data = ENFN->image_load(ENC, efl_file_get(eo_obj), o->cur->key, &load_error, &lo);
46 o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error); 49 o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error);
47 o->buffer_data_set = EINA_FALSE; 50 o->buffer_data_set = EINA_FALSE;
48 _evas_image_done_set(eo_obj, obj, o); 51 _evas_image_done_set(eo_obj, obj, o);
@@ -56,9 +59,13 @@ EOLIAN static Eina_Error
56_efl_canvas_image_efl_file_load(Eo *eo_obj, void *_pd EINA_UNUSED) 59_efl_canvas_image_efl_file_load(Eo *eo_obj, void *_pd EINA_UNUSED)
57{ 60{
58 if (efl_file_loaded_get(eo_obj)) return 0; 61 if (efl_file_loaded_get(eo_obj)) return 0;
59 Eina_Error err = efl_file_load(efl_super(eo_obj, MY_CLASS)); 62 Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
63 Eina_Error err = 0;
64
65 if (!o->skip_head)
66 err = efl_file_load(efl_super(eo_obj, MY_CLASS));
60 if (err) return err; 67 if (err) return err;
61 if (_evas_image_file_load(eo_obj)) 68 if (_evas_image_file_load(eo_obj, o))
62 return 0; 69 return 0;
63 return EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST; 70 return EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST;
64} 71}
diff --git a/src/lib/evas/canvas/evas_image_legacy.c b/src/lib/evas/canvas/evas_image_legacy.c
index dca17462b9..4e66bf2070 100644
--- a/src/lib/evas/canvas/evas_image_legacy.c
+++ b/src/lib/evas/canvas/evas_image_legacy.c
@@ -1286,7 +1286,11 @@ _evas_image_efl_file_load(Eo *obj, void *pd EINA_UNUSED)
1286{ 1286{
1287 EVAS_IMAGE_API(obj, EINA_FALSE); 1287 EVAS_IMAGE_API(obj, EINA_FALSE);
1288 if (efl_file_loaded_get(obj)) return 0; 1288 if (efl_file_loaded_get(obj)) return 0;
1289 Eina_Error err = efl_file_load(efl_super(obj, EVAS_IMAGE_CLASS)); 1289 Evas_Image_Data *o = efl_data_scope_get(obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
1290 Eina_Error err = 0;
1291
1292 if (!o->skip_head)
1293 err = efl_file_load(efl_super(obj, EVAS_IMAGE_CLASS));
1290 if (err) 1294 if (err)
1291 { 1295 {
1292 if (err == ENOENT) 1296 if (err == ENOENT)
@@ -1299,7 +1303,7 @@ _evas_image_efl_file_load(Eo *obj, void *pd EINA_UNUSED)
1299 _efl_canvas_image_load_error_set(obj, EFL_GFX_IMAGE_LOAD_ERROR_GENERIC); 1303 _efl_canvas_image_load_error_set(obj, EFL_GFX_IMAGE_LOAD_ERROR_GENERIC);
1300 return err; 1304 return err;
1301 } 1305 }
1302 if (_evas_image_file_load(obj)) 1306 if (_evas_image_file_load(obj, o))
1303 return 0; 1307 return 0;
1304 return EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST; 1308 return EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST;
1305} 1309}
diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h
index 6d18205d1f..310d91236b 100644
--- a/src/lib/evas/canvas/evas_image_private.h
+++ b/src/lib/evas/canvas/evas_image_private.h
@@ -168,7 +168,7 @@ void *_evas_image_pixels_get(Eo *eo_obj, Evas_Object_Protected_Data *obj, void *
168void _evas_image_fill_set(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h); 168void _evas_image_fill_set(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h);
169 169
170/* Efl.File */ 170/* Efl.File */
171Eina_Bool _evas_image_file_load(Eo *eo_obj); 171Eina_Bool _evas_image_file_load(Eo *eo_obj, Evas_Image_Data *o);
172void _evas_image_file_unload(Eo *eo_obj); 172void _evas_image_file_unload(Eo *eo_obj);
173const Eina_File *_evas_image_mmap_get(const Eo *eo_obj); 173const Eina_File *_evas_image_mmap_get(const Eo *eo_obj);
174const char *_evas_image_key_get(const Eo *eo_obj); 174const char *_evas_image_key_get(const Eo *eo_obj);