diff options
author | Vitalii Vorobiov <vi.vorobiov@samsung.com> | 2017-01-24 14:12:29 +0200 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-11-07 11:54:08 +0900 |
commit | 3f75c92ca9e559204c20228444810e8d482986d0 (patch) | |
tree | f1b9ee3fa6cebb2494d05a88a7d27c3c474bbdd4 | |
parent | d4a3d2f5de140778539c126fff2c759c6e4e6399 (diff) | |
download | efl-3f75c92ca9e559204c20228444810e8d482986d0.tar.gz |
evas_vg_cache: load svg from any file, not from defined only
so it doesn't only load from eet or edj only
but also from those any extensions who is ACTUALLY eet, but named as,
for example, like, "file_with_svg.dev"
@fix
-rw-r--r-- | src/lib/evas/vg/evas_vg_cache.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c index aa32a6f826..57f3cefc56 100644 --- a/src/lib/evas/vg/evas_vg_cache.c +++ b/src/lib/evas/vg/evas_vg_cache.c @@ -26,6 +26,11 @@ static const struct ext_loader_s loaders[] = MATCHING(".svg.gz", "svg") }; +static const char *loaders_name[] = +{ /* in order of most likely needed */ + "eet", "svg" +}; + static Evas_Module * _find_loader_module(const char *file) { @@ -57,6 +62,7 @@ _vg_load_from_file(const char *file, const char *key) Evas_Vg_Load_Func *loader; int error = EVAS_LOAD_ERROR_GENERIC; Vg_File_Data *evg_data = NULL; + unsigned int i; em = _find_loader_module(file); if (em) @@ -64,6 +70,23 @@ _vg_load_from_file(const char *file, const char *key) loader = em->functions; evg_data = loader->file_data(file, key, &error); } + else + { + for (i = 0; i < sizeof (loaders_name) / sizeof (char *); i++) + { + em = evas_module_find_type(EVAS_MODULE_TYPE_VG_LOADER, loaders_name[i]); + if (em) + { + loader = em->functions; + evg_data = loader->file_data(file, key, &error); + if (evg_data) + return evg_data; + } + else + DBG("could not find module '%s'", loaders_name[i]); + } + INF("exhausted all means to load image '%s'", file); + } return evg_data; } |