vector: backported from opensource 32/81432/3
authorSubhransu Mohanty <sub.mohanty@samsung.com>
Tue, 26 Jul 2016 07:26:41 +0000 (16:26 +0900)
committerSubhransu Mohanty <sub.mohanty@samsung.com>
Mon, 1 Aug 2016 01:38:17 +0000 (10:38 +0900)
Change-Id: I5268dd4f02334fd1e0822f09436cffc8b7cc1223

src/bin/edje/edje_cc_handlers.c
src/lib/efl/interfaces/efl_gfx_shape.c
src/lib/evas/vg/evas_vg_cache.c [new file with mode: 0644]
src/lib/evas/vg/evas_vg_eet_handler.c [new file with mode: 0644]

index 6171396..5309b75 100644 (file)
@@ -7323,6 +7323,14 @@ st_collections_group_parts_part_description_inherit(void)
                 }
               break;
            }
+      case EDJE_PART_TYPE_VECTOR:
+           {
+              Edje_Part_Description_Vector *ied = (Edje_Part_Description_Vector *) ed;
+              Edje_Part_Description_Vector *iparent = (Edje_Part_Description_Vector *) parent;
+              ied->vg.set = iparent->vg.set;
+              ied->vg.id = iparent->vg.id;
+              break;
+           }
      }
 
 #undef STRDUP
index f7c306f..7ffcda5 100644 (file)
@@ -275,13 +275,13 @@ _efl_gfx_shape_equal_commands_internal(Efl_Gfx_Shape_Data *a,
 static inline double
 interpolate(double from, double to, double pos_map)
 {
-   return (from * pos_map) + (to * (1.0 - pos_map));
+   return (from * (1.0 - pos_map)) + (to * pos_map);
 }
 
 static inline int
 interpolatei(int from, int to, double pos_map)
 {
-   return (from * pos_map) + (to * (1.0 - pos_map));
+   return (from * (1.0 - pos_map)) + (to * pos_map);
 }
 
 typedef struct _Efl_Gfx_Property Efl_Gfx_Property;
@@ -403,17 +403,17 @@ _efl_gfx_shape_interpolate(Eo *obj, Efl_Gfx_Shape_Data *pd,
 
 
    eo_do(obj,
-         efl_gfx_shape_stroke_scale_set(interpolate(property_to.scale, property_from.scale, pos_map)),
-         efl_gfx_shape_stroke_color_set(interpolatei(property_to.r, property_from.r, pos_map),
-                                        interpolatei(property_to.g, property_from.g, pos_map),
-                                        interpolatei(property_to.b, property_from.b, pos_map),
-                                        interpolatei(property_to.a, property_from.a, pos_map)),
-         efl_gfx_color_set(interpolatei(property_to.fr, property_from.fr, pos_map),
-                           interpolatei(property_to.fg, property_from.fg, pos_map),
-                           interpolatei(property_to.fb, property_from.fb, pos_map),
-                           interpolatei(property_to.fa, property_from.fa, pos_map)),
-         efl_gfx_shape_stroke_width_set(interpolate(property_to.w, property_from.w, pos_map)),
-         efl_gfx_shape_stroke_location_set(interpolate(property_to.centered, property_from.centered, pos_map)),
+         efl_gfx_shape_stroke_scale_set(interpolate(property_from.scale, property_to.scale, pos_map)),
+         efl_gfx_shape_stroke_color_set(interpolatei(property_from.r, property_to.r, pos_map),
+                                        interpolatei(property_from.g, property_to.g, pos_map),
+                                        interpolatei(property_from.b, property_to.b, pos_map),
+                                        interpolatei(property_from.a, property_to.a, pos_map)),
+         efl_gfx_color_set(interpolatei(property_from.fr, property_to.fr, pos_map),
+                           interpolatei(property_from.fg, property_to.fg, pos_map),
+                           interpolatei(property_from.fb, property_to.fb, pos_map),
+                           interpolatei(property_from.fa, property_to.fa, pos_map)),
+         efl_gfx_shape_stroke_width_set(interpolate(property_from.w, property_to.w, pos_map)),
+         efl_gfx_shape_stroke_location_set(interpolate(property_from.centered, property_to.centered, pos_map)),
          efl_gfx_shape_stroke_dash_set(dash, property_to.dash_length),
          efl_gfx_shape_stroke_cap_set(pos_map < 0.5 ? property_from.c : property_to.c),
          efl_gfx_shape_stroke_join_set(pos_map < 0.5 ? property_from.j : property_to.j),
diff --git a/src/lib/evas/vg/evas_vg_cache.c b/src/lib/evas/vg/evas_vg_cache.c
new file mode 100644 (file)
index 0000000..3123dec
--- /dev/null
@@ -0,0 +1,142 @@
+#include "evas_vg_cache.h"
+#include "evas_vg_common.h"
+
+static Evas_Cache_Svg* svg_cache = NULL;
+
+static void
+_evas_cache_vg_data_free_cb(void *data)
+{
+   Vg_Data *val = data;
+
+   eo_del(val->vg);
+   free(val);
+}
+
+static void
+_evas_cache_svg_entry_free_cb(void *data)
+{
+   Svg_Entry *entry = data;
+
+   eina_stringshare_del(entry->file);
+   free(entry->key);
+   eo_del(entry->root);
+   free(entry);
+}
+
+void
+evas_cache_svg_init(void)
+{
+   if (svg_cache)
+     {
+        svg_cache->ref++;
+        return;
+     }
+
+   svg_cache =  calloc(1, sizeof(Evas_Cache_Svg));
+   svg_cache->vg_hash = eina_hash_string_superfast_new(_evas_cache_vg_data_free_cb);
+   svg_cache->active = eina_hash_string_superfast_new(_evas_cache_svg_entry_free_cb);
+   svg_cache->ref++;
+}
+
+void
+evas_cache_svg_shutdown(void)
+{
+   if (!svg_cache) return;
+   svg_cache->ref--;
+   if (svg_cache->ref) return;
+   _evas_vg_svg_node_eet_destroy();
+   eina_hash_free(svg_cache->vg_hash);
+   eina_hash_free(svg_cache->active);
+   svg_cache = NULL;
+}
+
+static Vg_Data *
+_evas_cache_vg_data_find(const char *path, int vg_id)
+{
+   Vg_Data *vd;
+   Eina_Strbuf *key;
+
+   key = eina_strbuf_new();
+   eina_strbuf_append_printf(key, "%s/%d", path, vg_id);
+   vd = eina_hash_find(svg_cache->vg_hash, eina_strbuf_string_get(key));
+   if (!vd)
+     {
+        vd = _evas_vg_load_vg_data(path, vg_id);
+        eina_hash_add(svg_cache->vg_hash, eina_strbuf_string_get(key), vd);
+     }
+   eina_strbuf_free(key);
+   return vd;
+}
+
+static void
+_evas_cache_svg_vg_tree_update(Svg_Entry *entry)
+{
+   Vg_Data *src_vg = NULL, *dst_vg = NULL;
+   if(!entry) return;
+
+   if (!entry->src_vg)
+     {
+        entry->root = NULL;
+        return;
+     } 
+
+   src_vg = _evas_cache_vg_data_find(entry->file, entry->src_vg);
+   if (entry->dest_vg)
+     dst_vg = _evas_cache_vg_data_find(entry->file, entry->dest_vg);
+
+   entry->root = _evas_vg_dup_vg_tree(src_vg, dst_vg, entry->key_frame, entry->w, entry->h);
+   eina_stringshare_del(entry->file);
+   entry->file = NULL;
+}
+
+Svg_Entry*
+evas_cache_svg_find(const char *path,
+                    int src_vg, int dest_vg,
+                    float key_frame, int w, int h)
+{
+   Svg_Entry* se;
+   Eina_Strbuf *key;
+
+   if (!svg_cache) return NULL;
+
+   key = eina_strbuf_new();
+   eina_strbuf_append_printf(key, "%s/%d/%d/%.2f/%d/%d",
+                             path, src_vg, dest_vg, key_frame, w, h);
+   se = eina_hash_find(svg_cache->active, eina_strbuf_string_get(key));
+   if (!se)
+     {
+        se = calloc(1, sizeof(Svg_Entry));
+        se->file = eina_stringshare_add(path);
+        se->key_frame = key_frame;
+        se->src_vg = src_vg;
+        se->dest_vg = dest_vg;
+        se->w = w;
+        se->h = h;
+        se->key = eina_strbuf_string_steal(key);
+        eina_hash_direct_add(svg_cache->active, se->key, se);
+     }
+   eina_strbuf_free(key);
+   se->ref++;
+   return se;
+}
+
+Efl_VG*
+evas_cache_svg_vg_tree_get(Svg_Entry *entry)
+{
+   if (entry->root) return entry->root;
+
+   if (entry->file)
+     {
+        _evas_cache_svg_vg_tree_update(entry);
+     }
+   return entry->root;
+}
+
+void
+evas_cache_svg_entry_del(Svg_Entry *svg_entry)
+{
+   if (!svg_entry) return;
+
+   svg_entry->ref--;
+}
+
diff --git a/src/lib/evas/vg/evas_vg_eet_handler.c b/src/lib/evas/vg/evas_vg_eet_handler.c
new file mode 100644 (file)
index 0000000..6d99c3f
--- /dev/null
@@ -0,0 +1,814 @@
+#include "evas_vg_common.h"
+
+Eet_Data_Descriptor *_edje_edd_edje_rect_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_circle_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_ellipse_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_gradient_stops_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_linear_gradient_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_radial_gradient_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_style_gradient_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_style_property_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_matrix3_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_doc_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_defs_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_g_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_arc_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_path_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_polygon_node = NULL;
+Eet_Data_Descriptor *_edje_edd_edje_vg_node = NULL;
+
+#define FREE_DESCRIPTOR(eed)                      \
+  if (eed)                              \
+    {                                   \
+       eet_data_descriptor_free((eed)); \
+       (eed) = NULL;                    \
+    }
+
+static inline Eet_Data_Descriptor*
+_eet_for_rect_node(void)
+{
+   Eet_Data_Descriptor *eet;
+   Eet_Data_Descriptor_Class eetc;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Rect_Node);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Rect_Node, "x", x, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Rect_Node, "y", y, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Rect_Node, "w", w, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Rect_Node, "h", h, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Rect_Node, "rx", rx, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Rect_Node, "ry", ry, EET_T_DOUBLE);
+   return eet;
+}
+
+static inline Eet_Data_Descriptor*
+_eet_for_circle_node(void)
+{
+   Eet_Data_Descriptor *eet;
+   Eet_Data_Descriptor_Class eetc;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Circle_Node);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Circle_Node, "cx", cx, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Circle_Node, "cy", cy, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Circle_Node, "r", r, EET_T_DOUBLE);
+   return eet;
+}
+
+static inline Eet_Data_Descriptor*
+_eet_for_ellipse_node(void)
+{
+   Eet_Data_Descriptor *eet;
+   Eet_Data_Descriptor_Class eetc;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Ellipse_Node);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Ellipse_Node, "cx", cx, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Ellipse_Node, "cy", cy, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Ellipse_Node, "rx", rx, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Ellipse_Node, "ry", ry, EET_T_DOUBLE);
+   return eet;
+}
+
+
+static inline Eet_Data_Descriptor*
+_eet_for_gradient_stops(void)
+{
+   Eet_Data_Descriptor *eet;
+   Eet_Data_Descriptor_Class eetc;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Efl_Gfx_Gradient_Stop);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Efl_Gfx_Gradient_Stop, "offset", offset, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Efl_Gfx_Gradient_Stop, "r", r, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Efl_Gfx_Gradient_Stop, "g", g, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Efl_Gfx_Gradient_Stop, "b", b, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Efl_Gfx_Gradient_Stop, "a", a, EET_T_INT);
+   return eet;
+}
+
+static inline Eet_Data_Descriptor*
+_eet_for_linear_gradient(void)
+{
+   Eet_Data_Descriptor *eet;
+   Eet_Data_Descriptor_Class eetc;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Linear_Gradient);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Linear_Gradient, "x1", x1, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Linear_Gradient, "y1", y1, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Linear_Gradient, "x2", x2, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Linear_Gradient, "y2", y2, EET_T_DOUBLE);
+   return eet;
+}
+
+static inline Eet_Data_Descriptor*
+_eet_for_radial_gradient(void)
+{
+   Eet_Data_Descriptor *eet;
+   Eet_Data_Descriptor_Class eetc;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Radial_Gradient);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Radial_Gradient, "cx", cx, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Radial_Gradient, "cy", cy, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Radial_Gradient, "fx", fx, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Radial_Gradient, "fy", fy, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Radial_Gradient, "r", r, EET_T_DOUBLE);
+   return eet;
+}
+
+static inline Eet_Data_Descriptor*
+_eet_for_style_gradient(void)
+{
+   Eet_Data_Descriptor_Class eetc;
+
+   if (_edje_edd_edje_style_gradient_node) return _edje_edd_edje_style_gradient_node;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Style_Gradient);
+   _edje_edd_edje_style_gradient_node = eet_data_descriptor_stream_new(&eetc);
+   _edje_edd_edje_gradient_stops_node = _eet_for_gradient_stops();
+   _edje_edd_edje_linear_gradient_node = _eet_for_linear_gradient();
+   _edje_edd_edje_radial_gradient_node = _eet_for_radial_gradient();
+
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_style_gradient_node, Svg_Style_Gradient, "type", type, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_style_gradient_node, Svg_Style_Gradient, "id", id, EET_T_STRING);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_style_gradient_node, Svg_Style_Gradient, "spread", spread, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_style_gradient_node, Svg_Style_Gradient, "stops", stops, _edje_edd_edje_gradient_stops_node);
+   EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_style_gradient_node, Svg_Style_Gradient, "radial", radial, _edje_edd_edje_radial_gradient_node);
+   EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_style_gradient_node, Svg_Style_Gradient, "linear", linear, _edje_edd_edje_linear_gradient_node);
+
+   return _edje_edd_edje_style_gradient_node;
+}
+
+static inline Eet_Data_Descriptor*
+_eet_for_style_property(void)
+{
+   Eet_Data_Descriptor *eet, *eet_gradient, *eet_dash;
+   Eet_Data_Descriptor_Class eetc, eetc_dash;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Style_Property);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   eet_gradient = _eet_for_style_gradient();
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc_dash, Efl_Gfx_Dash);
+   eet_dash = eet_data_descriptor_stream_new(&eetc_dash);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet_dash, Efl_Gfx_Dash, "length", length, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet_dash, Efl_Gfx_Dash, "gap", gap, EET_T_DOUBLE);
+
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "r", r, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "g", g, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "b", b, EET_T_INT);
+   // for fill
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "fill.flags", fill.flags, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "fill.paint.r", fill.paint.r, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "fill.paint.g", fill.paint.g, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "fill.paint.b", fill.paint.b, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "fill.paint.none", fill.paint.none, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "fill.paint.cur_color", fill.paint.cur_color, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_SUB(eet, Svg_Style_Property, "fill.paint.gradient", fill.paint.gradient, eet_gradient);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "fill.paint.url", fill.paint.url, EET_T_STRING);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "fill.opacity", fill.opacity, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "fill.fill_rule", fill.fill_rule, EET_T_INT);
+
+   // for stroke
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.flags", stroke.flags, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.paint.r", stroke.paint.r, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.paint.g", stroke.paint.g, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.paint.b", stroke.paint.b, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.paint.none", stroke.paint.none, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.paint.cur_color", stroke.paint.cur_color, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_SUB(eet, Svg_Style_Property, "stroke.paint.gradient", stroke.paint.gradient, eet_gradient);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.paint.url", stroke.paint.url, EET_T_STRING);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.opacity", stroke.opacity, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.scale", stroke.scale, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.width", stroke.width, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.centered", stroke.centered, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.cap", stroke.cap, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.join", stroke.join, EET_T_INT);
+   EET_DATA_DESCRIPTOR_ADD_VAR_ARRAY(eet, Svg_Style_Property, "stroke.dash", stroke.dash, eet_dash);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Style_Property, "stroke.dash_count", stroke.dash_count, EET_T_INT);
+
+   return eet;
+}
+
+static Eet_Data_Descriptor*
+_eet_for_eina_matrix3(void)
+{
+   Eet_Data_Descriptor *eet;
+   Eet_Data_Descriptor_Class eetc;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Eina_Matrix3);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Eina_Matrix3, "xx", xx, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Eina_Matrix3, "xy", xy, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Eina_Matrix3, "xz", xz, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Eina_Matrix3, "yx", yx, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Eina_Matrix3, "yy", yy, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Eina_Matrix3, "yz", yz, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Eina_Matrix3, "zx", zx, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Eina_Matrix3, "zy", zy, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Eina_Matrix3, "zz", zz, EET_T_DOUBLE);
+
+   return eet;
+}
+
+static inline Eet_Data_Descriptor*
+_eet_for_doc_node(void)
+{
+   Eet_Data_Descriptor *eet;
+   Eet_Data_Descriptor_Class eetc;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Doc_Node);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Doc_Node, "width", width, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Doc_Node, "height", height, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Doc_Node, "vx", vx, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Doc_Node, "vy", vy, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Doc_Node, "vw", vw, EET_T_DOUBLE);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Doc_Node, "vh", vh, EET_T_DOUBLE);
+   return eet;
+}
+
+static inline Eet_Data_Descriptor*
+_eet_for_defs_node(void)
+{
+   Eet_Data_Descriptor *eet, *eet_gradient;
+   Eet_Data_Descriptor_Class eetc;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Defs_Node);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   eet_gradient = _eet_for_style_gradient();
+
+   EET_DATA_DESCRIPTOR_ADD_LIST(eet, Svg_Defs_Node, "gradients", gradients, eet_gradient);
+   return eet;
+}
+
+static inline Eet_Data_Descriptor*
+_eet_for_g_node(void)
+{
+   Eet_Data_Descriptor *eet;
+   Eet_Data_Descriptor_Class eetc;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_G_Node);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   return eet;
+}
+
+static inline Eet_Data_Descriptor*
+_eet_for_arc_node(void)
+{
+   Eet_Data_Descriptor *eet;
+   Eet_Data_Descriptor_Class eetc;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Arc_Node);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   return eet;
+}
+
+static inline Eet_Data_Descriptor*
+_eet_for_polygon_node(void)
+{
+   Eet_Data_Descriptor *eet;
+   Eet_Data_Descriptor_Class eetc;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Polygon_Node);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   EET_DATA_DESCRIPTOR_ADD_BASIC_VAR_ARRAY(eet, Svg_Polygon_Node, "points", points, EET_T_DOUBLE);
+   return eet;
+}
+
+static inline Eet_Data_Descriptor*
+_eet_for_path_node(void)
+{
+   Eet_Data_Descriptor *eet;
+   Eet_Data_Descriptor_Class eetc;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Path_Node);
+   eet = eet_data_descriptor_stream_new(&eetc);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(eet, Svg_Path_Node, "path", path, EET_T_STRING);
+   return eet;
+}
+
+struct
+{
+   Svg_Node_Type u;
+   const char       *name;
+} eet_mapping[] = {
+   { SVG_NODE_DOC, "doc" },
+   { SVG_NODE_G, "g" },
+   { SVG_NODE_DEFS, "defs" },
+   { SVG_NODE_ARC, "arc" },
+   { SVG_NODE_CIRCLE, "circle" },
+   { SVG_NODE_ELLIPSE, "ellipse" },
+   { SVG_NODE_POLYGON, "polygon" },
+   { SVG_NODE_POLYLINE, "polygon" },
+   { SVG_NODE_RECT, "rect" },
+   { SVG_NODE_PATH, "path" },
+   { SVG_NODE_UNKNOWN, NULL }
+};
+
+static const char *
+/* union
+   type_get() */
+_union_type_get(const void *data,
+                Eina_Bool  *unknow)
+{
+   const Svg_Node_Type *u = data;
+   int i;
+
+   if (unknow)
+     *unknow = EINA_FALSE;
+
+   for (i = 0; eet_mapping[i].name != NULL; ++i)
+     if (*u == eet_mapping[i].u)
+       return eet_mapping[i].name;
+
+   if (unknow)
+     *unknow = EINA_TRUE;
+   return NULL;
+} /* _union_type_get */
+
+static Eina_Bool
+_union_type_set(const char *type,
+                void       *data,
+                Eina_Bool   unknow)
+{
+   Svg_Node_Type *u = data;
+   int i;
+
+   if (unknow)
+     return EINA_FALSE;
+
+   for (i = 0; eet_mapping[i].name != NULL; ++i)
+     if (strcmp(eet_mapping[i].name, type) == 0)
+       {
+          *u = eet_mapping[i].u;
+          return EINA_TRUE;
+       }
+   return EINA_FALSE;
+} /* _union_type_set */
+
+EAPI Eet_Data_Descriptor *
+_evas_vg_svg_node_eet(void)
+{
+   Eet_Data_Descriptor *eet_union;
+   Eet_Data_Descriptor_Class eetc;
+
+   if (_edje_edd_edje_vg_node) return _edje_edd_edje_vg_node;
+
+   EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eetc, Svg_Node);
+   _edje_edd_edje_vg_node = eet_data_descriptor_stream_new(&eetc);
+
+   eetc.version = EET_DATA_DESCRIPTOR_CLASS_VERSION;
+   eetc.func.type_get = _union_type_get;
+   eetc.func.type_set = _union_type_set;
+   eet_union = eet_data_descriptor_stream_new(&eetc);
+
+   _edje_edd_edje_doc_node = _eet_for_doc_node();
+   _edje_edd_edje_g_node = _eet_for_g_node();
+   _edje_edd_edje_defs_node = _eet_for_defs_node();
+   _edje_edd_edje_arc_node = _eet_for_arc_node();
+   _edje_edd_edje_circle_node = _eet_for_circle_node();
+   _edje_edd_edje_ellipse_node = _eet_for_ellipse_node();
+   _edje_edd_edje_rect_node = _eet_for_rect_node();
+   _edje_edd_edje_path_node = _eet_for_path_node();
+   _edje_edd_edje_polygon_node = _eet_for_polygon_node();
+   _edje_edd_edje_style_property_node = _eet_for_style_property();
+   _edje_edd_edje_matrix3_node = _eet_for_eina_matrix3();
+
+
+   EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "doc", _edje_edd_edje_doc_node);
+   EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "g", _edje_edd_edje_g_node);
+   EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "defs", _edje_edd_edje_defs_node);
+   EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "arc", _edje_edd_edje_arc_node);
+   EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "circle", _edje_edd_edje_circle_node);
+   EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "ellipse", _edje_edd_edje_ellipse_node);
+   EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "rect", _edje_edd_edje_rect_node);
+   EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "path", _edje_edd_edje_path_node);
+   EET_DATA_DESCRIPTOR_ADD_MAPPING(eet_union, "polygon", _edje_edd_edje_polygon_node);
+
+   EET_DATA_DESCRIPTOR_ADD_UNION(_edje_edd_edje_vg_node, Svg_Node, "node", node, type, eet_union);
+
+
+   EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_vg_node, Svg_Node, "child", child, _edje_edd_edje_vg_node);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_vg_node, Svg_Node, "id", id, EET_T_STRING);
+   EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_vg_node, Svg_Node, "style", style, _edje_edd_edje_style_property_node);
+   EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_vg_node, Svg_Node, "transform", transform, _edje_edd_edje_matrix3_node);
+
+   return _edje_edd_edje_vg_node;
+}
+
+EAPI void 
+_evas_vg_svg_node_eet_destroy(void)
+{
+   FREE_DESCRIPTOR(_edje_edd_edje_rect_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_circle_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_ellipse_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_gradient_stops_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_linear_gradient_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_radial_gradient_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_style_gradient_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_style_property_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_matrix3_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_doc_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_defs_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_g_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_arc_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_path_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_polygon_node);
+   FREE_DESCRIPTOR(_edje_edd_edje_vg_node);
+}
+
+
+
+static Efl_VG *
+_apply_gradient_property(Svg_Style_Gradient *g)
+{
+   Efl_VG *grad_obj = NULL;
+   Efl_Gfx_Gradient_Stop *stops, *stop;
+   int stop_count = 0, i = 0;
+   Eina_List *l;
+
+   if (g->type == SVG_LINEAR_GRADIENT)
+     {
+        grad_obj = eo_add(EFL_VG_GRADIENT_LINEAR_CLASS, NULL);
+        evas_vg_gradient_linear_start_set(grad_obj, g->linear->x1, g->linear->y1);
+        evas_vg_gradient_linear_end_set(grad_obj, g->linear->x2, g->linear->y2);
+     }
+   else if (g->type == SVG_RADIAL_GRADIENT)
+     {
+        grad_obj = eo_add(EFL_VG_GRADIENT_RADIAL_CLASS, NULL);
+        evas_vg_gradient_radial_center_set(grad_obj, g->radial->cx, g->radial->cy);
+        evas_vg_gradient_radial_radius_set(grad_obj, g->radial->r);
+        evas_vg_gradient_radial_focal_set(grad_obj, g->radial->fx, g->radial->fy);
+     }
+   else
+     {
+        // not a known gradient
+        return NULL;
+     }
+   // apply common prperty
+   evas_vg_gradient_spread_set(grad_obj, g->spread);
+   // update the stops
+   stop_count = eina_list_count(g->stops);
+   if (stop_count)
+     {
+        stops = calloc(stop_count, sizeof(Efl_Gfx_Gradient_Stop));
+        i = 0;
+        EINA_LIST_FOREACH(g->stops, l, stop)
+          {
+             stops[i].r = stop->r;
+             stops[i].g = stop->g;
+             stops[i].b = stop->b;
+             stops[i].a = stop->a;
+             stops[i].offset = stop->offset;
+             i++;
+          }
+        evas_vg_gradient_stop_set(grad_obj, stops, stop_count);
+        free(stops);
+     }
+   return grad_obj;
+}
+
+// vg tree creation
+static void
+_apply_vg_property(Svg_Node *node, Efl_VG *vg)
+{
+   Svg_Style_Property *style = node->style;
+
+   // update the vg name
+   if (node->id)
+     evas_vg_node_name_set(vg, node->id);
+
+   // apply the transformation
+   if (node->transform)
+     evas_vg_node_transformation_set(vg, node->transform);
+
+   if (node->type == SVG_NODE_G) return;
+
+   // apply the fill style property
+   eo_do(vg, efl_gfx_shape_fill_rule_set(style->fill.fill_rule));
+   // if fill property is NULL then do nothing
+   if (style->fill.paint.none)
+     {
+        //do nothing
+     }
+   else if (style->fill.paint.gradient)
+     {
+        // if the fill has gradient then apply.
+        evas_vg_shape_fill_set(vg, _apply_gradient_property(style->fill.paint.gradient));
+     }
+   else if (style->fill.paint.cur_color)
+     {
+        // apply the current style color
+        evas_vg_node_color_set(vg, style->r, style->g,
+                               style->b, style->fill.opacity);
+     }
+   else
+     {
+        // apply the fill color
+        evas_vg_node_color_set(vg, style->fill.paint.r, style->fill.paint.g,
+                               style->fill.paint.b, style->fill.opacity);
+     }
+
+   // apply the stroke style property
+   //@TODO HACK, fix the below api to take the stroke width as pixels
+   // rightnow it draws double the pixel (inside and outside the outline)
+   evas_vg_shape_stroke_width_set(vg, style->stroke.width/2.0);
+   evas_vg_shape_stroke_cap_set(vg, style->stroke.cap);
+   evas_vg_shape_stroke_join_set(vg, style->stroke.join);
+   evas_vg_shape_stroke_scale_set(vg, style->stroke.scale);
+   // if stroke property is NULL then do nothing
+   if (style->stroke.paint.none)
+     {
+        //do nothing
+     }
+   else if (style->stroke.paint.gradient)
+     {
+        // if the fill has gradient then apply.
+        evas_vg_shape_stroke_fill_set(vg, _apply_gradient_property(style->stroke.paint.gradient));
+     }
+   else if (style->stroke.paint.url)
+     {
+        // apply the color pointed by url
+        // TODO
+     }
+   else if (style->stroke.paint.cur_color)
+     {
+        // apply the current style color
+        evas_vg_shape_stroke_color_set(vg, style->r, style->g,
+                                       style->b, style->stroke.opacity);
+     }
+   else
+     {
+        // apply the stroke color
+        evas_vg_shape_stroke_color_set(vg, style->stroke.paint.r, style->stroke.paint.g,
+                                       style->stroke.paint.b, style->stroke.opacity);
+     }
+}
+
+static void
+_add_polyline(Efl_VG *vg, double *array, int size, Eina_Bool polygon)
+{
+   int i;
+
+   if (size < 2) return;
+
+   evas_vg_shape_shape_append_move_to(vg, array[0], array[1]);
+   for (i=2; i < size; i+=2)
+     evas_vg_shape_shape_append_line_to(vg, array[i], array[i+1]);
+
+   if (polygon)
+     evas_vg_shape_shape_append_close(vg);
+}
+
+static void
+_create_vg_node(Svg_Node *node, Efl_VG *parent)
+{
+   Efl_VG *vg = NULL;
+   Svg_Node *child;
+   Eina_List *l;
+
+   switch (node->type)
+     {
+        case SVG_NODE_G:
+           {
+              vg = evas_vg_container_add(parent);
+              _apply_vg_property(node, vg);
+              EINA_LIST_FOREACH(node->child, l, child)
+                {
+                   _create_vg_node(child, vg);
+                }
+              return;
+           }
+           break;
+        case SVG_NODE_PATH:
+           vg = evas_vg_shape_add(parent);
+           evas_vg_shape_shape_append_svg_path(vg, node->node.path.path);
+           break;
+        case SVG_NODE_POLYGON:
+           vg = evas_vg_shape_add(parent);
+           _add_polyline(vg, node->node.polygon.points, node->node.polygon.points_count, EINA_TRUE);
+           break;
+        case SVG_NODE_POLYLINE:
+           _add_polyline(vg, node->node.polygon.points, node->node.polygon.points_count, EINA_FALSE);
+           break;
+        case SVG_NODE_ELLIPSE:
+           vg = evas_vg_shape_add(parent);
+           evas_vg_shape_shape_append_arc(vg, node->node.ellipse.cx - node->node.ellipse.rx,
+                                          node->node.ellipse.cy - node->node.ellipse.ry,
+                                          2*node->node.ellipse.rx, 2*node->node.ellipse.ry, 0, 360);
+           evas_vg_shape_shape_append_close(vg);
+           break;
+        case SVG_NODE_CIRCLE:
+           vg = evas_vg_shape_add(parent);
+           evas_vg_shape_shape_append_circle(vg, node->node.circle.cx, node->node.circle.cy, node->node.circle.r);
+           break;
+        case SVG_NODE_RECT:
+           vg = evas_vg_shape_add(parent);
+           evas_vg_shape_shape_append_rect(vg, node->node.rect.x, node->node.rect.y, node->node.rect.w, node->node.rect.h,
+                                           node->node.rect.rx, node->node.rect.ry);
+           break;
+       default:
+           break;
+     }
+   _apply_vg_property(node, vg);
+}
+
+static void
+_apply_stroke_scale(Efl_VG *node, double scale)
+{
+   Efl_VG *child;
+   Eina_Iterator *itr;
+
+   if (eo_isa(node, EFL_VG_CONTAINER_CLASS))
+     {
+        eo_do(node, itr = efl_vg_container_children_get());
+        EINA_ITERATOR_FOREACH(itr, child)
+          _apply_stroke_scale(child, scale);
+        eina_iterator_free(itr);
+     }
+   else
+     {
+         evas_vg_shape_stroke_scale_set(node, scale);
+     }
+}
+
+Vg_Data *
+_evas_vg_load_vg_data(Eina_Stringshare *path, int svg_id)
+{
+   Eina_List *l;
+   Vg_Data *vector;
+   char svg_key[20];
+   Eet_Data_Descriptor *svg_node_eet;
+   Svg_Node *child;
+   Svg_Node *node;
+   Eet_File *ef;
+   Efl_VG *root = NULL;
+
+   ef = eet_open(path, EET_FILE_MODE_READ);
+   if (!ef) return NULL;
+
+   // create and put it in the cache.
+   vector = calloc(1, sizeof(Vg_Data));
+   vector->svg_id = svg_id;
+
+   snprintf(svg_key, sizeof(svg_key), "edje/vectors/%i", svg_id);
+   svg_node_eet = _evas_vg_svg_node_eet();
+   node = eet_data_read(ef, svg_node_eet, svg_key);
+
+   if (!node || (node->type != SVG_NODE_DOC))
+     {
+        root = NULL;
+     }
+   else
+     {
+        root = evas_vg_container_add(NULL);
+        EINA_LIST_FOREACH(node->child, l, child)
+          {
+             _create_vg_node(child, root);
+          }
+        vector->x = node->node.doc.vx;
+        vector->y = node->node.doc.vy;
+        vector->w = node->node.doc.vw;
+        vector->h = node->node.doc.vh;
+     }
+   vector->vg = root;
+   _evas_vg_svg_node_free(node);
+   eet_close(ef);
+
+   return vector;
+}
+
+static void
+_apply_transformation(Efl_VG *root, double w, double h, Vg_Data *vg_data)
+{
+   double sx, sy, scale;
+   Eina_Matrix3 m;
+
+   sx = w/vg_data->w;
+   sy = h/vg_data->h;
+   scale = sx < sy ? sx: sy;
+   eina_matrix3_identity(&m);
+   // allign hcenter and vcenter
+   //@TODO take care of the preserveaspectratio attribute
+   eina_matrix3_translate(&m, (w - vg_data->w * scale)/2.0, (h - vg_data->h * scale)/2.0);
+   eina_matrix3_scale(&m, scale, scale);
+   eina_matrix3_translate(&m, -vg_data->x, -vg_data->y);
+   evas_vg_node_transformation_set(root, &m);
+   _apply_stroke_scale(root, scale);
+}
+
+Efl_VG *
+_evas_vg_dup_vg_tree(Vg_Data *src, Vg_Data *dest, float pos, double w, double h)
+{
+
+   Efl_VG *root;
+   Eina_Matrix3 m;
+
+   if (!src) return NULL;
+   if (w==0 || h ==0 ) return NULL;
+   if (!dest)
+     {
+        root = evas_vg_container_add(NULL);
+        evas_vg_node_dup(root, src->vg);
+        _apply_transformation(root, w, h, src);
+     }
+   else
+     {
+        root = evas_vg_container_add(NULL);
+        evas_vg_node_dup(root, src->vg);
+
+        // for start vector
+        _apply_transformation(src->vg, w, h, src);
+
+        // for end vector
+        _apply_transformation(dest->vg, w, h, dest);
+
+        // do the interpolation
+        if (!evas_vg_node_interpolate(root, src->vg, dest->vg, pos))
+          {
+             ;//ERR(" Can't interpolate check the svg file \n");
+          }
+        // performance hack
+        // instead of duplicating the tree and applying the transformation
+        // i just updated the transformation matrix and reset it back to null.
+        // assumption is that the root vg will never have a transformation
+        eina_matrix3_identity(&m);
+        evas_vg_node_transformation_set(src->vg, &m);
+        evas_vg_node_transformation_set(dest->vg, &m);
+     }
+   return root;
+}
+
+static void
+_svg_style_gradient_free(Svg_Style_Gradient *grad)
+{
+   Efl_Gfx_Gradient_Stop *stop;
+
+   if (!grad) return;
+
+   eina_stringshare_del(grad->id);
+   eina_stringshare_del(grad->ref);
+   free(grad->radial);
+   free(grad->linear);
+
+   EINA_LIST_FREE(grad->stops, stop)
+     {
+        free(stop);
+     }
+   free(grad);
+}
+
+static void
+_node_style_free(Svg_Style_Property *style)
+{
+   if (!style) return;
+
+   _svg_style_gradient_free(style->fill.paint.gradient);
+   eina_stringshare_del(style->fill.paint.url);
+   _svg_style_gradient_free(style->stroke.paint.gradient);
+   eina_stringshare_del(style->stroke.paint.url);
+   free(style);
+}
+
+EAPI void
+_evas_vg_svg_node_free(Svg_Node *node)
+{
+   Svg_Node *child;
+   Svg_Style_Gradient *grad;
+
+   if (!node) return;
+
+   EINA_LIST_FREE(node->child, child)
+     {
+        _evas_vg_svg_node_free(child);
+     }
+
+   eina_stringshare_del(node->id);
+   free(node->transform);
+   _node_style_free(node->style);
+   switch (node->type)
+     {
+        case SVG_NODE_PATH:
+           eina_stringshare_del(node->node.path.path);
+           break;
+        case SVG_NODE_POLYGON:
+        case SVG_NODE_POLYLINE:
+           free(node->node.polygon.points);
+           break;
+        case SVG_NODE_DOC:
+           _evas_vg_svg_node_free(node->node.doc.defs);
+           break;
+        case SVG_NODE_DEFS:
+           EINA_LIST_FREE(node->node.defs.gradients, grad)
+             {
+                _svg_style_gradient_free(grad);
+             }
+           break;
+        default:
+           break;
+     }
+  free(node);
+}