summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-02-26 09:41:14 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-06 13:30:49 +0100
commitbab8fcc4425ab8523d39ad445673cb1953e5c25f (patch)
tree293908c10b89b5a69c6466cd2a9ca47a3cd9bcbd
parent576229bf6a1cd2b154d5d8770764b8e12778f28b (diff)
evas/image: implement efl.file loading and mmap getters to correctly handle skip_head
when this property is set, the mixin implementation of efl_file_load() is never called, which means the internal loaded flag (and related data) is not set, and so the values for these properties must instead be returned directly from the image data Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11423
-rw-r--r--src/lib/evas/canvas/efl_canvas_image.c18
-rw-r--r--src/lib/evas/canvas/efl_canvas_image.eo2
-rw-r--r--src/lib/evas/canvas/evas_image_eo.c2
-rw-r--r--src/lib/evas/canvas/evas_image_legacy.c18
4 files changed, 40 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_image.c b/src/lib/evas/canvas/efl_canvas_image.c
index 4021f32fc1..d45efcbf73 100644
--- a/src/lib/evas/canvas/efl_canvas_image.c
+++ b/src/lib/evas/canvas/efl_canvas_image.c
@@ -68,6 +68,24 @@ _evas_image_file_load(Eo *eo_obj, Evas_Image_Data *o)
68 return EINA_TRUE; 68 return EINA_TRUE;
69} 69}
70 70
71EOLIAN static Eina_Bool
72_efl_canvas_image_efl_file_loaded_get(const Eo *eo_obj, void *_pd EINA_UNUSED)
73{
74 Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
75 if (!o->skip_head)
76 return efl_file_loaded_get(efl_super(eo_obj, MY_CLASS));
77 return !!o->cur->f;
78}
79
80EOLIAN static const Eina_File *
81_efl_canvas_image_efl_file_mmap_get(const Eo *eo_obj, void *_pd EINA_UNUSED)
82{
83 Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
84 if (!o->skip_head)
85 return efl_file_mmap_get(efl_super(eo_obj, MY_CLASS));
86 return o->cur->f;
87}
88
71EOLIAN static Eina_Error 89EOLIAN static Eina_Error
72_efl_canvas_image_efl_file_load(Eo *eo_obj, void *_pd EINA_UNUSED) 90_efl_canvas_image_efl_file_load(Eo *eo_obj, void *_pd EINA_UNUSED)
73{ 91{
diff --git a/src/lib/evas/canvas/efl_canvas_image.eo b/src/lib/evas/canvas/efl_canvas_image.eo
index 72e1894f61..230b84a9bc 100644
--- a/src/lib/evas/canvas/efl_canvas_image.eo
+++ b/src/lib/evas/canvas/efl_canvas_image.eo
@@ -16,6 +16,8 @@ class @beta Efl.Canvas.Image extends Efl.Canvas.Image_Internal implements
16 Efl.Gfx.Buffer.buffer_size { get; } 16 Efl.Gfx.Buffer.buffer_size { get; }
17 Efl.Gfx.Buffer.buffer_map; 17 Efl.Gfx.Buffer.buffer_map;
18 Efl.Gfx.Buffer.buffer_unmap; 18 Efl.Gfx.Buffer.buffer_unmap;
19 Efl.File.loaded { get; }
20 Efl.File.mmap { get; }
19 Efl.File.load; 21 Efl.File.load;
20 Efl.File.unload; 22 Efl.File.unload;
21 Efl.Gfx.Frame_Controller.animated { get; } 23 Efl.Gfx.Frame_Controller.animated { get; }
diff --git a/src/lib/evas/canvas/evas_image_eo.c b/src/lib/evas/canvas/evas_image_eo.c
index 2d4f39ff39..4eeac15542 100644
--- a/src/lib/evas/canvas/evas_image_eo.c
+++ b/src/lib/evas/canvas/evas_image_eo.c
@@ -14,6 +14,8 @@ _evas_image_class_initializer(Efl_Class *klass)
14#endif 14#endif
15 15
16 EFL_OPS_DEFINE(ops, 16 EFL_OPS_DEFINE(ops,
17 EFL_OBJECT_OP_FUNC(efl_file_loaded_get, _evas_image_efl_file_loaded_get),
18 EFL_OBJECT_OP_FUNC(efl_file_mmap_get, _evas_image_efl_file_mmap_get),
17 EFL_OBJECT_OP_FUNC(efl_file_load, _evas_image_efl_file_load), 19 EFL_OBJECT_OP_FUNC(efl_file_load, _evas_image_efl_file_load),
18 EFL_OBJECT_OP_FUNC(efl_file_unload, _evas_image_efl_file_unload), 20 EFL_OBJECT_OP_FUNC(efl_file_unload, _evas_image_efl_file_unload),
19 EVAS_IMAGE_EXTRA_OPS 21 EVAS_IMAGE_EXTRA_OPS
diff --git a/src/lib/evas/canvas/evas_image_legacy.c b/src/lib/evas/canvas/evas_image_legacy.c
index 4e66bf2070..2702b31f5e 100644
--- a/src/lib/evas/canvas/evas_image_legacy.c
+++ b/src/lib/evas/canvas/evas_image_legacy.c
@@ -1281,6 +1281,24 @@ evas_object_image_alpha_mask_set(Evas_Object *eo_obj EINA_UNUSED, Eina_Bool isma
1281 EVAS_IMAGE_LEGACY_API(eo_obj); 1281 EVAS_IMAGE_LEGACY_API(eo_obj);
1282} 1282}
1283 1283
1284EOLIAN static Eina_Bool
1285_evas_image_efl_file_loaded_get(const Eo *eo_obj, void *_pd EINA_UNUSED)
1286{
1287 Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
1288 if (!o->skip_head)
1289 return efl_file_loaded_get(efl_super(eo_obj, EVAS_IMAGE_CLASS));
1290 return !!o->cur->f;
1291}
1292
1293EOLIAN static const Eina_File *
1294_evas_image_efl_file_mmap_get(const Eo *eo_obj, void *_pd EINA_UNUSED)
1295{
1296 Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
1297 if (!o->skip_head)
1298 return efl_file_mmap_get(efl_super(eo_obj, EVAS_IMAGE_CLASS));
1299 return o->cur->f;
1300}
1301
1284EOLIAN static Eina_Error 1302EOLIAN static Eina_Error
1285_evas_image_efl_file_load(Eo *obj, void *pd EINA_UNUSED) 1303_evas_image_efl_file_load(Eo *obj, void *pd EINA_UNUSED)
1286{ 1304{