summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2018-12-07 17:14:15 +0900
committerHermet Park <hermetpark@gmail.com>2018-12-07 17:14:15 +0900
commit093e32a0fb9259023cfb581ed4b5f5baf8391b72 (patch)
tree831f32457445261d54ab6a82baf9602be2da82a7 /src
parentcfc66dd0bd8467e41b0d3584fc5e33f9497412b2 (diff)
evas vg: code refactoring.
keep internal variable and structre names consisteny. no logical changes.
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/efl_canvas_vg_object.c10
-rw-r--r--src/lib/evas/canvas/evas_vg_private.h49
-rw-r--r--src/lib/evas/include/evas_private.h11
-rw-r--r--src/lib/evas/vg/evas_vg_cache.c227
-rw-r--r--src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c6
-rw-r--r--src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c4
6 files changed, 158 insertions, 149 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_vg_object.c b/src/lib/evas/canvas/efl_canvas_vg_object.c
index 0824aba1e1..4acc75f58b 100644
--- a/src/lib/evas/canvas/efl_canvas_vg_object.c
+++ b/src/lib/evas/canvas/efl_canvas_vg_object.c
@@ -162,7 +162,7 @@ _efl_canvas_vg_object_root_node_set(Eo *eo_obj, Efl_Canvas_Vg_Object_Data *pd, E
162 { 162 {
163 if (!pd->user_entry) 163 if (!pd->user_entry)
164 { 164 {
165 pd->user_entry = malloc(sizeof(User_Vg_Entry)); 165 pd->user_entry = malloc(sizeof(Vg_User_Entry));
166 if (!pd->user_entry) 166 if (!pd->user_entry)
167 { 167 {
168 ERR("Failed to alloc user entry data while setting root node"); 168 ERR("Failed to alloc user entry data while setting root node");
@@ -255,12 +255,10 @@ _efl_canvas_vg_object_viewbox_align_get(const Eo *obj EINA_UNUSED, Efl_Canvas_Vg
255 if (align_y) *align_y = pd->align_y; 255 if (align_y) *align_y = pd->align_y;
256} 256}
257 257
258// file set and save api implementation
259
260EOLIAN static Eina_Bool 258EOLIAN static Eina_Bool
261_efl_canvas_vg_object_efl_file_file_set(Eo *obj, Efl_Canvas_Vg_Object_Data *pd, const char *file, const char *key) 259_efl_canvas_vg_object_efl_file_file_set(Eo *obj, Efl_Canvas_Vg_Object_Data *pd, const char *file, const char *key)
262{ 260{
263 Evas_Cache_Vg_Entry *old_entry; 261 Vg_Cache_Entry *old_entry;
264 int w, h; 262 int w, h;
265 263
266 if (!file) return EINA_FALSE; 264 if (!file) return EINA_FALSE;
@@ -480,7 +478,7 @@ _cache_vg_entry_render(Evas_Object_Protected_Data *obj,
480 void *engine, void *output, void *context, void *surface, 478 void *engine, void *output, void *context, void *surface,
481 int x, int y, int w, int h, Eina_Bool do_async) 479 int x, int y, int w, int h, Eina_Bool do_async)
482{ 480{
483 Evas_Cache_Vg_Entry *vg_entry = pd->vg_entry; 481 Vg_Cache_Entry *vg_entry = pd->vg_entry;
484 Efl_VG *root, *dupe_root; 482 Efl_VG *root, *dupe_root;
485 483
486 // if the size changed in between path set and the draw call; 484 // if the size changed in between path set and the draw call;
@@ -528,7 +526,7 @@ _user_vg_entry_render(Evas_Object_Protected_Data *obj,
528 void *engine, void *output, void *context, void *surface, 526 void *engine, void *output, void *context, void *surface,
529 int x, int y, int w, int h, Eina_Bool do_async) 527 int x, int y, int w, int h, Eina_Bool do_async)
530{ 528{
531 User_Vg_Entry *user_entry = pd->user_entry; 529 Vg_User_Entry *user_entry = pd->user_entry;
532 530
533 //if the size doesn't match, drop previous cache surface. 531 //if the size doesn't match, drop previous cache surface.
534 if ((user_entry->w != w ) || 532 if ((user_entry->w != w ) ||
diff --git a/src/lib/evas/canvas/evas_vg_private.h b/src/lib/evas/canvas/evas_vg_private.h
index 95010c5c86..4652f9ac52 100644
--- a/src/lib/evas/canvas/evas_vg_private.h
+++ b/src/lib/evas/canvas/evas_vg_private.h
@@ -9,17 +9,14 @@ typedef struct _Efl_Canvas_Vg_Gradient_Data Efl_Canvas_Vg_Gradient_Data;
9typedef struct _Efl_Canvas_Vg_Interpolation Efl_Canvas_Vg_Interpolation; 9typedef struct _Efl_Canvas_Vg_Interpolation Efl_Canvas_Vg_Interpolation;
10typedef struct _Efl_Canvas_Vg_Object_Data Efl_Canvas_Vg_Object_Data; 10typedef struct _Efl_Canvas_Vg_Object_Data Efl_Canvas_Vg_Object_Data;
11 11
12typedef struct _Evas_Cache_Vg_Entry Evas_Cache_Vg_Entry; 12typedef struct _Vg_Cache
13typedef struct _Evas_Cache_Vg Evas_Cache_Vg;
14
15struct _Evas_Cache_Vg
16{ 13{
17 Eina_Hash *vg_hash; 14 Eina_Hash *vfd_hash;
18 Eina_Hash *active; 15 Eina_Hash *vg_entry_hash;
19 int ref; 16 int ref;
20}; 17} Vg_Cache;
21 18
22struct _Evas_Cache_Vg_Entry 19typedef struct _Vg_Cache_Entry
23{ 20{
24 char *hash_key; 21 char *hash_key;
25 Eina_Stringshare *file; 22 Eina_Stringshare *file;
@@ -28,27 +25,29 @@ struct _Evas_Cache_Vg_Entry
28 int h; 25 int h;
29 Efl_VG *root; 26 Efl_VG *root;
30 int ref; 27 int ref;
31}; 28} Vg_Cache_Entry;
32 29
33typedef struct _User_Vg_Entry 30// holds the vg tree info set by the user
31typedef struct _Vg_User_Entry
34{ 32{
35 int w; // current surface width 33 int w; // current surface width
36 int h; // current surface height 34 int h; // current surface height
37 Efl_VG *root; 35 Efl_VG *root;
38}User_Vg_Entry; // holds the vg tree info set by the user 36} Vg_User_Entry;
39 37
40struct _Efl_Canvas_Vg_Object_Data 38struct _Efl_Canvas_Vg_Object_Data
41{ 39{
42 Efl_VG *root; 40 Efl_VG *root;
43 Evas_Cache_Vg_Entry *vg_entry; 41 Vg_Cache_Entry *vg_entry;
44 User_Vg_Entry *user_entry; // holds the user set vg tree 42 Vg_User_Entry *user_entry; //holds the user set vg tree
45 Eina_Rect fill; 43 Eina_Rect fill;
46 Eina_Rect viewbox; 44 Eina_Rect viewbox;
47 unsigned int width, height; 45 unsigned int width, height;
48 Eina_Array cleanup; 46 Eina_Array cleanup;
49 double align_x, align_y; 47 double align_x, align_y;
50 Efl_Canvas_Vg_Fill_Mode fill_mode; 48 Efl_Canvas_Vg_Fill_Mode fill_mode;
51 Eina_Bool changed; 49
50 Eina_Bool changed : 1;
52}; 51};
53 52
54struct _Efl_Canvas_Vg_Node_Data 53struct _Efl_Canvas_Vg_Node_Data
@@ -59,7 +58,7 @@ struct _Efl_Canvas_Vg_Node_Data
59 Efl_Canvas_Vg_Node *mask; 58 Efl_Canvas_Vg_Node *mask;
60 Ector_Renderer *renderer; 59 Ector_Renderer *renderer;
61 60
62 Efl_VG *vg_obj; 61 Efl_VG *vg_obj; //...Not necessary!!
63 62
64 void (*render_pre)(Eo *obj, Eina_Matrix3 *parent, Ector_Surface *s, void *data, Efl_Canvas_Vg_Node_Data *nd); 63 void (*render_pre)(Eo *obj, Eina_Matrix3 *parent, Ector_Surface *s, void *data, Efl_Canvas_Vg_Node_Data *nd);
65 void *data; 64 void *data;
@@ -101,9 +100,9 @@ struct _Efl_Canvas_Vg_Interpolation
101 100
102void evas_cache_vg_init(void); 101void evas_cache_vg_init(void);
103void evas_cache_vg_shutdown(void); 102void evas_cache_vg_shutdown(void);
104Evas_Cache_Vg_Entry* evas_cache_vg_entry_find(const char *file, const char *key, int w, int h); 103Vg_Cache_Entry* evas_cache_vg_entry_find(const char *file, const char *key, int w, int h);
105Efl_VG* evas_cache_vg_tree_get(Evas_Cache_Vg_Entry *svg_entry); 104Efl_VG* evas_cache_vg_tree_get(Vg_Cache_Entry *svg_entry);
106void evas_cache_vg_entry_del(Evas_Cache_Vg_Entry *svg_entry); 105void evas_cache_vg_entry_del(Vg_Cache_Entry *svg_entry);
107Vg_File_Data * evas_cache_vg_file_info(const char *file, const char *key); 106Vg_File_Data * evas_cache_vg_file_info(const char *file, const char *key);
108 107
109Eina_Bool evas_vg_save_to_file(Vg_File_Data *evg_data, const char *file, const char *key, const char *flags); 108Eina_Bool evas_vg_save_to_file(Vg_File_Data *evg_data, const char *file, const char *key, const char *flags);
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 00841fa8ca..75761f06d9 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1505,19 +1505,22 @@ struct _Evas_Image_Save_Func
1505 1505
1506struct _Vg_File_Data 1506struct _Vg_File_Data
1507{ 1507{
1508 Efl_VG *root;
1509 Evas_Vg_Load_Func *loader;
1508 Eina_Rectangle view_box; 1510 Eina_Rectangle view_box;
1509 Efl_VG *root; 1511 Eina_Bool preserve_aspect : 1; //Used in SVG
1510 Eina_Bool preserve_aspect;
1511}; 1512};
1512 1513
1513struct _Evas_Vg_Load_Func 1514struct _Evas_Vg_Load_Func
1514{ 1515{
1515 Vg_File_Data *(*file_data) (const char *file, const char *key, int *error); 1516 Vg_File_Data *(*file_open) (const char *file, const char *key, int *error);
1517 Eina_Bool (*file_close) (Vg_File_Data *vfd);
1518 Eina_Bool (*file_data) (Vg_File_Data *vfd);
1516}; 1519};
1517 1520
1518struct _Evas_Vg_Save_Func 1521struct _Evas_Vg_Save_Func
1519{ 1522{
1520 int (*vg_save) (Vg_File_Data *vg, const char *file, const char *key, int compress); 1523 int (*file_save) (Vg_File_Data *vfd, const char *file, const char *key, int compress);
1521}; 1524};
1522 1525
1523#ifdef __cplusplus 1526#ifdef __cplusplus
diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c
index 4ef27b7d5c..863f6660cd 100644
--- a/src/lib/evas/vg/evas_vg_cache.c
+++ b/src/lib/evas/vg/evas_vg_cache.c
@@ -6,7 +6,7 @@
6#include "evas_private.h" 6#include "evas_private.h"
7#include "evas_vg_private.h" 7#include "evas_vg_private.h"
8 8
9static Evas_Cache_Vg* vg_cache = NULL; 9static Vg_Cache* vg_cache = NULL;
10 10
11struct ext_loader_s 11struct ext_loader_s
12{ 12{
@@ -15,6 +15,13 @@ struct ext_loader_s
15 const char *loader; 15 const char *loader;
16}; 16};
17 17
18struct ext_saver_s
19{
20 unsigned int length;
21 const char *extension;
22 const char *saver;
23};
24
18#define MATCHING(Ext, Module) { sizeof(Ext)-1, Ext, Module } 25#define MATCHING(Ext, Module) { sizeof(Ext)-1, Ext, Module }
19 26
20static const struct ext_loader_s loaders[] = 27static const struct ext_loader_s loaders[] =
@@ -31,6 +38,13 @@ static const char *loaders_name[] =
31 "eet", "svg" 38 "eet", "svg"
32}; 39};
33 40
41static const struct ext_saver_s savers[] =
42{ /* map extensions to savers to use for good first-guess tries */
43 MATCHING(".eet", "eet"),
44 MATCHING(".edj", "eet"),
45 MATCHING(".svg", "svg")
46};
47
34static Evas_Module * 48static Evas_Module *
35_find_loader_module(const char *file) 49_find_loader_module(const char *file)
36{ 50{
@@ -61,14 +75,19 @@ _vg_load_from_file(const char *file, const char *key)
61 Evas_Module *em; 75 Evas_Module *em;
62 Evas_Vg_Load_Func *loader; 76 Evas_Vg_Load_Func *loader;
63 int error = EVAS_LOAD_ERROR_GENERIC; 77 int error = EVAS_LOAD_ERROR_GENERIC;
64 Vg_File_Data *evg_data = NULL; 78 Vg_File_Data *vfd;
65 unsigned int i; 79 unsigned int i;
66 80
67 em = _find_loader_module(file); 81 em = _find_loader_module(file);
68 if (em) 82 if (em)
69 { 83 {
70 loader = em->functions; 84 loader = em->functions;
71 evg_data = loader->file_data(file, key, &error); 85 vfd = loader->file_open(file, key, &error);
86 if (vfd)
87 {
88 vfd->loader = loader;
89 return vfd;
90 }
72 } 91 }
73 else 92 else
74 { 93 {
@@ -78,34 +97,18 @@ _vg_load_from_file(const char *file, const char *key)
78 if (em) 97 if (em)
79 { 98 {
80 loader = em->functions; 99 loader = em->functions;
81 evg_data = loader->file_data(file, key, &error); 100 vfd = loader->file_open(file, key, &error);
82 if (evg_data) 101 {
83 return evg_data; 102 vfd->loader = loader;
103 return vfd;
104 }
84 } 105 }
85 else
86 DBG("could not find module '%s'", loaders_name[i]);
87 } 106 }
88 INF("exhausted all means to load image '%s'", file);
89 } 107 }
90 return evg_data; 108 WRN("Exhausted all means to load vector file = %s", file);
109 return NULL;
91} 110}
92 111
93
94// evg file save
95struct ext_saver_s
96{
97 unsigned int length;
98 const char *extension;
99 const char *saver;
100};
101
102static const struct ext_saver_s savers[] =
103{ /* map extensions to savers to use for good first-guess tries */
104 MATCHING(".eet", "eet"),
105 MATCHING(".edj", "eet"),
106 MATCHING(".svg", "svg")
107};
108
109static Evas_Module * 112static Evas_Module *
110_find_saver_module(const char *file) 113_find_saver_module(const char *file)
111{ 114{
@@ -130,8 +133,28 @@ _find_saver_module(const char *file)
130 return em; 133 return em;
131} 134}
132 135
136static void
137_evas_cache_vg_data_free_cb(void *data)
138{
139 Vg_File_Data *val = data;
140 efl_unref(val->root);
141 free(val);
142}
143
144static void
145_evas_cache_vg_entry_free_cb(void *data)
146{
147 Vg_Cache_Entry *vg_entry = data;
148
149 eina_stringshare_del(vg_entry->file);
150 eina_stringshare_del(vg_entry->key);
151 free(vg_entry->hash_key);
152 efl_unref(vg_entry->root);
153 free(vg_entry);
154}
155
133Eina_Bool 156Eina_Bool
134evas_vg_save_to_file(Vg_File_Data *evg_data, const char *file, const char *key, const char *flags) 157evas_vg_save_to_file(Vg_File_Data *vfd, const char *file, const char *key, const char *flags)
135{ 158{
136 Evas_Module *em; 159 Evas_Module *em;
137 Evas_Vg_Save_Func *saver; 160 Evas_Vg_Save_Func *saver;
@@ -162,7 +185,7 @@ evas_vg_save_to_file(Vg_File_Data *evg_data, const char *file, const char *key,
162 if (em) 185 if (em)
163 { 186 {
164 saver = em->functions; 187 saver = em->functions;
165 error = saver->vg_save(evg_data, file, key, compress); 188 error = saver->file_save(vfd, file, key, compress);
166 } 189 }
167 190
168 if (error) 191 if (error)
@@ -171,28 +194,6 @@ evas_vg_save_to_file(Vg_File_Data *evg_data, const char *file, const char *key,
171 return EINA_TRUE; 194 return EINA_TRUE;
172} 195}
173 196
174
175
176static void
177_evas_cache_vg_data_free_cb(void *data)
178{
179 Vg_File_Data *val = data;
180 efl_unref(val->root);
181 free(val);
182}
183
184static void
185_evas_cache_svg_entry_free_cb(void *data)
186{
187 Evas_Cache_Vg_Entry *entry = data;
188
189 eina_stringshare_del(entry->file);
190 eina_stringshare_del(entry->key);
191 free(entry->hash_key);
192 efl_unref(entry->root);
193 free(entry);
194}
195
196void 197void
197evas_cache_vg_init(void) 198evas_cache_vg_init(void)
198{ 199{
@@ -201,9 +202,15 @@ evas_cache_vg_init(void)
201 vg_cache->ref++; 202 vg_cache->ref++;
202 return; 203 return;
203 } 204 }
204 vg_cache = calloc(1, sizeof(Evas_Cache_Vg)); 205 vg_cache = calloc(1, sizeof(Vg_Cache));
205 vg_cache->vg_hash = eina_hash_string_superfast_new(_evas_cache_vg_data_free_cb); 206 if (!vg_cache)
206 vg_cache->active = eina_hash_string_superfast_new(_evas_cache_svg_entry_free_cb); 207 {
208 CRI("Failed to alloc Vg_Cache");
209 return;
210 }
211
212 vg_cache->vfd_hash = eina_hash_string_superfast_new(_evas_cache_vg_data_free_cb);
213 vg_cache->vg_entry_hash = eina_hash_string_superfast_new(_evas_cache_vg_entry_free_cb);
207 vg_cache->ref++; 214 vg_cache->ref++;
208} 215}
209 216
@@ -212,9 +219,9 @@ evas_cache_vg_shutdown(void)
212{ 219{
213 if (!vg_cache) return; 220 if (!vg_cache) return;
214 vg_cache->ref--; 221 vg_cache->ref--;
215 if (vg_cache->ref) return; 222 if (vg_cache->ref > 0) return;
216 eina_hash_free(vg_cache->vg_hash); 223 eina_hash_free(vg_cache->vfd_hash);
217 eina_hash_free(vg_cache->active); 224 eina_hash_free(vg_cache->vg_entry_hash);
218 free(vg_cache); 225 free(vg_cache);
219 vg_cache = NULL; 226 vg_cache = NULL;
220} 227}
@@ -222,89 +229,91 @@ evas_cache_vg_shutdown(void)
222Vg_File_Data * 229Vg_File_Data *
223evas_cache_vg_file_info(const char *file, const char *key) 230evas_cache_vg_file_info(const char *file, const char *key)
224{ 231{
225 Vg_File_Data *vd; 232 Vg_File_Data *vfd;
226 Eina_Strbuf *hash_key; 233 Eina_Strbuf *hash_key;
227 234
228 hash_key = eina_strbuf_new(); 235 hash_key = eina_strbuf_new();
229 eina_strbuf_append_printf(hash_key, "%s/%s", file, key); 236 eina_strbuf_append_printf(hash_key, "%s/%s", file, key);
230 vd = eina_hash_find(vg_cache->vg_hash, eina_strbuf_string_get(hash_key)); 237 vfd = eina_hash_find(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key));
231 if (!vd) 238 if (!vfd)
232 { 239 {
233 vd = _vg_load_from_file(file, key); 240 vfd = _vg_load_from_file(file, key);
234 //File is exists. 241 //File exists.
235 if (vd) eina_hash_add(vg_cache->vg_hash, eina_strbuf_string_get(hash_key), vd); 242 if (vfd) eina_hash_add(vg_cache->vfd_hash, eina_strbuf_string_get(hash_key), vfd);
236 } 243 }
237 eina_strbuf_free(hash_key); 244 eina_strbuf_free(hash_key);
238 return vd; 245 return vfd;
239} 246}
240 247
241static void 248static void
242_apply_transformation(Efl_VG *root, double w, double h, Vg_File_Data *vg_data) 249_local_transformation(Efl_VG *root, double w, double h, Vg_File_Data *vfd)
243{ 250{
244 double sx = 0, sy= 0, scale; 251 double sx = 0, sy= 0, scale;
245 Eina_Matrix3 m; 252 Eina_Matrix3 m;
246 253
247 if (vg_data->view_box.w) 254 if (vfd->view_box.w)
248 sx = w/vg_data->view_box.w; 255 sx = w/vfd->view_box.w;
249 if (vg_data->view_box.h) 256 if (vfd->view_box.h)
250 sy = h/vg_data->view_box.h; 257 sy = h/vfd->view_box.h;
258
251 scale = sx < sy ? sx: sy; 259 scale = sx < sy ? sx: sy;
252 eina_matrix3_identity(&m); 260 eina_matrix3_identity(&m);
261
253 // allign hcenter and vcenter 262 // allign hcenter and vcenter
254 if (vg_data->preserve_aspect) 263 if (vfd->preserve_aspect)
255 { 264 {
256 eina_matrix3_translate(&m, (w - vg_data->view_box.w * scale)/2.0, (h - vg_data->view_box.h * scale)/2.0); 265 eina_matrix3_translate(&m, (w - vfd->view_box.w * scale)/2.0, (h - vfd->view_box.h * scale)/2.0);
257 eina_matrix3_scale(&m, scale, scale); 266 eina_matrix3_scale(&m, scale, scale);
258 eina_matrix3_translate(&m, -vg_data->view_box.x, -vg_data->view_box.y); 267 eina_matrix3_translate(&m, -vfd->view_box.x, -vfd->view_box.y);
259 } 268 }
260 else 269 else
261 { 270 {
262 eina_matrix3_scale(&m, sx, sy); 271 eina_matrix3_scale(&m, sx, sy);
263 eina_matrix3_translate(&m, -vg_data->view_box.x, -vg_data->view_box.y); 272 eina_matrix3_translate(&m, -vfd->view_box.x, -vfd->view_box.y);
264 } 273 }
265 efl_canvas_vg_node_transformation_set(root, &m); 274 efl_canvas_vg_node_transformation_set(root, &m);
266} 275}
267 276
268static Efl_VG * 277static Efl_VG *
269_evas_vg_dup_vg_tree(Vg_File_Data *fd, double w, double h) 278_evas_vg_dup_vg_tree(Vg_File_Data *vfd, double w, double h)
270{ 279{
271 Efl_VG *root; 280 Efl_VG *root;
272 281
273 if (!fd) return NULL; 282 if (!vfd) return NULL;
274 if (w < 1 || h < 1) return NULL; 283 if (w < 1 || h < 1) return NULL;
275 284
276 root = efl_duplicate(fd->root); 285 root = efl_duplicate(vfd->root);
277 _apply_transformation(root, w, h, fd); 286 _local_transformation(root, w, h, vfd);
278 287
279 return root; 288 return root;
280} 289}
281 290
282static void 291static void
283_evas_cache_svg_vg_tree_update(Evas_Cache_Vg_Entry *entry) 292_evas_cache_vg_tree_update(Vg_Cache_Entry *vg_entry)
284{ 293{
285 Vg_File_Data *src_vg = NULL; 294 Vg_File_Data *vfd = NULL;
286 if(!entry) return; 295 if(!vg_entry) return;
287 296
288 if (!entry->file) 297 if (!vg_entry->file)
289 { 298 {
290 entry->root = NULL; 299 vg_entry->root = NULL;
291 return; 300 return;
292 } 301 }
293 302
294 src_vg = evas_cache_vg_file_info(entry->file, entry->key); 303 vfd = evas_cache_vg_file_info(vg_entry->file, vg_entry->key);
295 304
296 entry->root = _evas_vg_dup_vg_tree(src_vg, entry->w, entry->h); 305 vg_entry->root = _evas_vg_dup_vg_tree(vfd, vg_entry->w, vg_entry->h);
297 eina_stringshare_del(entry->file); 306 eina_stringshare_del(vg_entry->file);
298 eina_stringshare_del(entry->key); 307 eina_stringshare_del(vg_entry->key);
299 entry->file = NULL; 308 vg_entry->file = NULL;
300 entry->key = NULL; 309 vg_entry->key = NULL;
301} 310}
302 311
303Evas_Cache_Vg_Entry* 312Vg_Cache_Entry*
304evas_cache_vg_entry_find(const char *file, const char *key, 313evas_cache_vg_entry_find(const char *file, const char *key,
305 int w, int h) 314 int w, int h)
306{ 315{
307 Evas_Cache_Vg_Entry* se; 316 Vg_Cache_Entry* vg_entry;
308 Eina_Strbuf *hash_key; 317 Eina_Strbuf *hash_key;
309 318
310 if (!vg_cache) return NULL; 319 if (!vg_cache) return NULL;
@@ -312,45 +321,45 @@ evas_cache_vg_entry_find(const char *file, const char *key,
312 hash_key = eina_strbuf_new(); 321 hash_key = eina_strbuf_new();
313 eina_strbuf_append_printf(hash_key, "%s/%s/%d/%d", 322 eina_strbuf_append_printf(hash_key, "%s/%s/%d/%d",
314 file, key, w, h); 323 file, key, w, h);
315 se = eina_hash_find(vg_cache->active, eina_strbuf_string_get(hash_key)); 324 vg_entry = eina_hash_find(vg_cache->vg_entry_hash, eina_strbuf_string_get(hash_key));
316 if (!se) 325 if (!vg_entry)
317 { 326 {
318 se = calloc(1, sizeof(Evas_Cache_Vg_Entry)); 327 vg_entry = calloc(1, sizeof(Vg_Cache_Entry));
319 if (!se) 328 if (!vg_entry)
320 { 329 {
321 CRI("Failed to alloc Vg_Cache_Entry"); 330 CRI("Failed to alloc Vg_Cache_Entry");
322 eina_strbuf_free(hash_key); 331 eina_strbuf_free(hash_key);
323 return NULL; 332 return NULL;
324 } 333 }
325 se->file = eina_stringshare_add(file); 334 vg_entry->file = eina_stringshare_add(file);
326 se->key = eina_stringshare_add(key); 335 vg_entry->key = eina_stringshare_add(key);
327 se->w = w; 336 vg_entry->w = w;
328 se->h = h; 337 vg_entry->h = h;
329 se->hash_key = eina_strbuf_string_steal(hash_key); 338 vg_entry->hash_key = eina_strbuf_string_steal(hash_key);
330 eina_hash_direct_add(vg_cache->active, se->hash_key, se); 339 eina_hash_direct_add(vg_cache->vg_entry_hash, vg_entry->hash_key, vg_entry);
331 } 340 }
332 eina_strbuf_free(hash_key); 341 eina_strbuf_free(hash_key);
333 se->ref++; 342 vg_entry->ref++;
334 return se; 343 return vg_entry;
335} 344}
336 345
337Efl_VG* 346Efl_VG*
338evas_cache_vg_tree_get(Evas_Cache_Vg_Entry *entry) 347evas_cache_vg_tree_get(Vg_Cache_Entry *vg_entry)
339{ 348{
340 if (entry->root) return entry->root; 349 if (vg_entry->root) return vg_entry->root;
341 350
342 if (entry->file) 351 if (vg_entry->file)
343 _evas_cache_svg_vg_tree_update(entry); 352 _evas_cache_vg_tree_update(vg_entry);
344 353
345 return entry->root; 354 return vg_entry->root;
346} 355}
347 356
348void 357void
349evas_cache_vg_entry_del(Evas_Cache_Vg_Entry *svg_entry) 358evas_cache_vg_entry_del(Vg_Cache_Entry *vg_entry)
350{ 359{
351 if (!svg_entry) return; 360 if (!vg_entry) return;
352 361
353 svg_entry->ref--; 362 vg_entry->ref--;
354 // FIXME implement delete logic (LRU) 363 // FIXME implement delete logic (LRU)
355} 364}
356 365
diff --git a/src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c b/src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c
index 27263cfeb1..2a8356b007 100644
--- a/src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c
+++ b/src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c
@@ -13,7 +13,7 @@ static int _evas_vg_loader_eet_log_dom = -1;
13#define INF(...) EINA_LOG_DOM_INFO(_evas_vg_loader_eet_log_dom, __VA_ARGS__) 13#define INF(...) EINA_LOG_DOM_INFO(_evas_vg_loader_eet_log_dom, __VA_ARGS__)
14 14
15static Vg_File_Data* 15static Vg_File_Data*
16evas_vg_load_file_data_eet(const char *file, const char *key, int *error EINA_UNUSED) 16evas_vg_load_file_open_eet(const char *file, const char *key, int *error EINA_UNUSED)
17{ 17{
18 Eet_Data_Descriptor *svg_node_eet; 18 Eet_Data_Descriptor *svg_node_eet;
19 Svg_Node *node; 19 Svg_Node *node;
@@ -44,7 +44,7 @@ evas_vg_load_file_data_eet(const char *file, const char *key, int *error EINA_UN
44 44
45static Evas_Vg_Load_Func evas_vg_load_eet_func = 45static Evas_Vg_Load_Func evas_vg_load_eet_func =
46{ 46{
47 evas_vg_load_file_data_eet 47 evas_vg_load_file_open_eet
48}; 48};
49 49
50static int 50static int
@@ -87,4 +87,4 @@ EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_VG_LOADER, vg_loader, eet);
87 87
88#ifndef EVAS_STATIC_BUILD_VG_EET 88#ifndef EVAS_STATIC_BUILD_VG_EET
89EVAS_EINA_MODULE_DEFINE(vg_loader, eet); 89EVAS_EINA_MODULE_DEFINE(vg_loader, eet);
90#endif \ No newline at end of file 90#endif
diff --git a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
index 61f443b806..67a5fc63d0 100644
--- a/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
+++ b/src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c
@@ -2327,7 +2327,7 @@ _update_gradient(Svg_Node *node, Eina_List *grad_list)
2327} 2327}
2328 2328
2329static Vg_File_Data* 2329static Vg_File_Data*
2330evas_vg_load_file_data_svg(const char *file, const char *key EINA_UNUSED, int *error EINA_UNUSED) 2330evas_vg_load_file_open_svg(const char *file, const char *key EINA_UNUSED, int *error EINA_UNUSED)
2331{ 2331{
2332 Evas_SVG_Loader loader = { 2332 Evas_SVG_Loader loader = {
2333 NULL, NULL, NULL, NULL, NULL, 0, EINA_FALSE 2333 NULL, NULL, NULL, NULL, NULL, 0, EINA_FALSE
@@ -2377,7 +2377,7 @@ evas_vg_load_file_data_svg(const char *file, const char *key EINA_UNUSED, int *e
2377 2377
2378static Evas_Vg_Load_Func evas_vg_load_svg_func = 2378static Evas_Vg_Load_Func evas_vg_load_svg_func =
2379{ 2379{
2380 evas_vg_load_file_data_svg 2380 evas_vg_load_file_open_svg
2381}; 2381};
2382 2382
2383static int 2383static int