aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_canvas3d_texture.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:09 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-02-27 13:17:10 -0500
commit6326e18b3fb2a4757f8ffa22be5d55a75da23049 (patch)
tree31d586b52638aa0d0b1c759869a8e3368c9daf5d /src/lib/evas/canvas/evas_canvas3d_texture.c
parentelua tests: fix distcheck (diff)
downloadefl-6326e18b3fb2a4757f8ffa22be5d55a75da23049.tar.gz
efl.file: improve api a bit
Summary: the previous implementation/api had a number of issues: * "file" property contained both "file" and "key" values - also performed file loading operation * "load_error" property which was specific to image objects * no methods for controlling file loading/unloading this patch attempts the following changes: * split "file" property into "file" and "key" properties - also remove "key" from existing "mmap" property * remove "load_error" * directly return error codes from operations * add "load" and "unload" methods for directly controlling load state * add implicit file loading if file/mmap is set during construction * rewrite all efl.file implementations to move file loading into load() method * rewrite all usage of efl.file api based on these changes * add C extension functions to mimic previous behavior ref https://phab.enlightenment.org/T7577 Reviewers: segfaultxavi, bu5hm4n, cedric Reviewed By: segfaultxavi Subscribers: vitor.sousa, #reviewers, #committers Tags: #efl_api Maniphest Tasks: https://phab.enlightenment.org/T7577 Differential Revision: https://phab.enlightenment.org/D8018
Diffstat (limited to '')
-rw-r--r--src/lib/evas/canvas/evas_canvas3d_texture.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/evas/canvas/evas_canvas3d_texture.c b/src/lib/evas/canvas/evas_canvas3d_texture.c
index 540f6c6b39..5533e18373 100644
--- a/src/lib/evas/canvas/evas_canvas3d_texture.c
+++ b/src/lib/evas/canvas/evas_canvas3d_texture.c
@@ -372,25 +372,27 @@ _evas_canvas3d_texture_data_set(Eo *obj, Evas_Canvas3D_Texture_Data *pd,
evas_canvas3d_object_change(obj, EVAS_CANVAS3D_STATE_TEXTURE_DATA, NULL);
}
-EOLIAN static void
-_evas_canvas3d_texture_efl_file_mmap_get(const Eo *obj EINA_UNUSED, Evas_Canvas3D_Texture_Data *pd, const Eina_File **f, const char **key)
-{
- if (f) *f = pd->f;
- if (key) *key = pd->key;
-}
-
-EOLIAN static Eina_Bool
-_evas_canvas3d_texture_efl_file_mmap_set(Eo *obj, Evas_Canvas3D_Texture_Data *pd, const Eina_File *f, const char *key)
+EOLIAN static Eina_Error
+_evas_canvas3d_texture_efl_file_load(Eo *obj, Evas_Canvas3D_Texture_Data *pd)
{
-
Evas_Image_Load_Opts lo;
int load_error;
Eo *evas = NULL;
void *image;
+ const Eina_File *f;
+ const char *key;
+
+ if (efl_file_loaded_get(obj)) return 0;
evas = evas_object_evas_get(obj);
Evas_Public_Data *e = efl_data_scope_get(evas, EVAS_CANVAS_CLASS);
+ Eina_Error err = efl_file_load(efl_super(obj, MY_CLASS));
+ if (err) return err;
+
+ f = efl_file_mmap_get(obj);
+ key = efl_file_key_get(obj);
+
if (!pd->engine_data && e->engine.func->texture_new)
pd->engine_data = e->engine.func->texture_new(_evas_engine_context(e), pd->atlas_enable);