summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_calc.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-10-27 14:31:37 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-10-27 14:58:38 +0900
commitec1acca74d2422165d9bb229043922d3f87a8790 (patch)
tree2907bc7a3471a3b5d207ae53a4ce58b1242ab6a0 /src/lib/edje/edje_calc.c
parent8329c98d5f5c3b3b8c974f39a461ef22f069c174 (diff)
evas vg: Add FIXME and fix strbuf use
This is the result of a really quick review of the new VG code. Most of it was moved around, but this merge includes the following: - Move logic from edje to evas - Create static lib for common VG handling - Add file_set() API - Add a basic VG cache in evas side - Add savers modules, implement loaders and savers.
Diffstat (limited to 'src/lib/edje/edje_calc.c')
-rw-r--r--src/lib/edje/edje_calc.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 0a9efdcfc9..d752e2360a 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -3696,13 +3696,13 @@ _edje_svg_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EINA_U
3696{ 3696{
3697 int new_svg = -1; //invalid svg 3697 int new_svg = -1; //invalid svg
3698 int w, h; 3698 int w, h;
3699 char src_key[20], dest_key[20]; 3699 char src_key[32], dest_key[32];
3700 Efl_VG *src_root, *dest_root, *root; 3700 Efl_VG *src_root, *dest_root, *root;
3701 3701
3702 evas_object_geometry_get(ep->object, NULL, NULL, &w, &h); 3702 evas_object_geometry_get(ep->object, NULL, NULL, &w, &h);
3703 if( (w == 0) || (h == 0)) return; 3703 if( (w == 0) || (h == 0)) return;
3704 3704
3705 sprintf(src_key, "edje/vectors/%i", chosen_desc->vg.id); 3705 snprintf(src_key, sizeof(src_key), "edje/vectors/%i", chosen_desc->vg.id);
3706 3706
3707 if (ep->param2) 3707 if (ep->param2)
3708 { 3708 {
@@ -3719,22 +3719,27 @@ _edje_svg_recalc_apply(Edje *ed, Edje_Real_Part *ep, Edje_Calc_Params *p3 EINA_U
3719 } 3719 }
3720 else 3720 else
3721 { 3721 {
3722 sprintf(dest_key, "edje/vectors/%i", new_svg); 3722 snprintf(dest_key, sizeof(dest_key), "edje/vectors/%i", new_svg);
3723 3723
3724 efl_file_set(ep->object, ed->file->path, src_key); 3724 efl_file_set(ep->object, ed->file->path, src_key);
3725 src_root = efl_canvas_vg_root_node_get(ep->object); 3725 src_root = efl_canvas_vg_root_node_get(ep->object);
3726 efl_ref(src_root);
3726 3727
3727 efl_file_set(ep->object, ed->file->path, dest_key); 3728 efl_file_set(ep->object, ed->file->path, dest_key);
3728 dest_root = efl_canvas_vg_root_node_get(ep->object); 3729 dest_root = efl_canvas_vg_root_node_get(ep->object);
3730 efl_ref(dest_root);
3729 3731
3732 // FIXME: root = dup(), root.interpolate(dest).
3730 root = evas_vg_container_add(NULL); 3733 root = evas_vg_container_add(NULL);
3731 evas_vg_node_dup(root, src_root); 3734 evas_vg_node_dup(root, src_root);
3732 3735
3733 if (!evas_vg_node_interpolate(root, src_root, dest_root, pos)) 3736 if (!evas_vg_node_interpolate(root, src_root, dest_root, pos))
3734 { 3737 {
3735 ERR(" Can't interpolate check the svg file \n"); 3738 ERR("Can't interpolate check the svg file");
3736 } 3739 }
3737 efl_canvas_vg_root_node_set(ep->object, root); 3740 efl_canvas_vg_root_node_set(ep->object, root);
3741 efl_unref(src_root);
3742 efl_unref(dest_root);
3738 } 3743 }
3739} 3744}
3740 3745