summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitalii Vorobiov <vi.vorobiov@samsung.com>2017-01-24 14:12:29 +0200
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 11:54:08 +0900
commit3f75c92ca9e559204c20228444810e8d482986d0 (patch)
treef1b9ee3fa6cebb2494d05a88a7d27c3c474bbdd4
parentd4a3d2f5de140778539c126fff2c759c6e4e6399 (diff)
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.c23
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[] =
26 MATCHING(".svg.gz", "svg") 26 MATCHING(".svg.gz", "svg")
27}; 27};
28 28
29static const char *loaders_name[] =
30{ /* in order of most likely needed */
31 "eet", "svg"
32};
33
29static Evas_Module * 34static Evas_Module *
30_find_loader_module(const char *file) 35_find_loader_module(const char *file)
31{ 36{
@@ -57,6 +62,7 @@ _vg_load_from_file(const char *file, const char *key)
57 Evas_Vg_Load_Func *loader; 62 Evas_Vg_Load_Func *loader;
58 int error = EVAS_LOAD_ERROR_GENERIC; 63 int error = EVAS_LOAD_ERROR_GENERIC;
59 Vg_File_Data *evg_data = NULL; 64 Vg_File_Data *evg_data = NULL;
65 unsigned int i;
60 66
61 em = _find_loader_module(file); 67 em = _find_loader_module(file);
62 if (em) 68 if (em)
@@ -64,6 +70,23 @@ _vg_load_from_file(const char *file, const char *key)
64 loader = em->functions; 70 loader = em->functions;
65 evg_data = loader->file_data(file, key, &error); 71 evg_data = loader->file_data(file, key, &error);
66 } 72 }
73 else
74 {
75 for (i = 0; i < sizeof (loaders_name) / sizeof (char *); i++)
76 {
77 em = evas_module_find_type(EVAS_MODULE_TYPE_VG_LOADER, loaders_name[i]);
78 if (em)
79 {
80 loader = em->functions;
81 evg_data = loader->file_data(file, key, &error);
82 if (evg_data)
83 return evg_data;
84 }
85 else
86 DBG("could not find module '%s'", loaders_name[i]);
87 }
88 INF("exhausted all means to load image '%s'", file);
89 }
67 return evg_data; 90 return evg_data;
68} 91}
69 92