summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVitalii Vorobiov <vi.vorobiov@samsung.com>2017-02-14 17:37:27 +0200
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-07 11:54:09 +0900
commitfac649c7f41c148ac4750c626bf93a5fd9b4ae49 (patch)
tree9349abac6934ddd8344952ee6f22e59c3bcb485c
parent73bfd4f04d6b9885bab271d16c688f97dcf626a3 (diff)
vg_common: parse and store userSpaceOnUse (for gradient) when it is set
So it can be calculated during the draw later on
-rw-r--r--src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c11
-rw-r--r--src/static_libs/vg_common/vg_common.c5
-rw-r--r--src/static_libs/vg_common/vg_common.h1
3 files changed, 16 insertions, 1 deletions
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 4b4913b695..5f7b632144 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
@@ -1374,6 +1374,7 @@ _clone_gradient(Svg_Style_Gradient *from)
1374 grad->id = _copy_id(from->id); 1374 grad->id = _copy_id(from->id);
1375 grad->ref = _copy_id(from->ref); 1375 grad->ref = _copy_id(from->ref);
1376 grad->spread = from->spread; 1376 grad->spread = from->spread;
1377 grad->user_space = from->user_space;
1377 grad->stops = _clone_grad_stops(from->stops); 1378 grad->stops = _clone_grad_stops(from->stops);
1378 if (grad->type == SVG_LINEAR_GRADIENT) 1379 if (grad->type == SVG_LINEAR_GRADIENT)
1379 { 1380 {
@@ -1659,6 +1660,10 @@ _attr_parse_radial_gradient_node(void *data, const char *key, const char *value)
1659 { 1660 {
1660 grad->ref = _id_from_href(value); 1661 grad->ref = _id_from_href(value);
1661 } 1662 }
1663 else if (!strcmp(key, "gradientUnits") && !strcmp(value, "userSpaceOnUse"))
1664 {
1665 grad->user_space = EINA_TRUE;
1666 }
1662 1667
1663 return EINA_TRUE; 1668 return EINA_TRUE;
1664} 1669}
@@ -1777,6 +1782,10 @@ _attr_parse_linear_gradient_node(void *data, const char *key, const char *value)
1777 { 1782 {
1778 grad->ref = _id_from_href(value); 1783 grad->ref = _id_from_href(value);
1779 } 1784 }
1785 else if (!strcmp(key, "gradientUnits") && !strcmp(value, "userSpaceOnUse"))
1786 {
1787 grad->user_space = EINA_TRUE;
1788 }
1780 1789
1781 return EINA_TRUE; 1790 return EINA_TRUE;
1782} 1791}
@@ -2185,4 +2194,4 @@ EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_VG_LOADER, vg_loader, svg);
2185 2194
2186#ifndef EVAS_STATIC_BUILD_VG_SVG 2195#ifndef EVAS_STATIC_BUILD_VG_SVG
2187EVAS_EINA_MODULE_DEFINE(vg_loader, svg); 2196EVAS_EINA_MODULE_DEFINE(vg_loader, svg);
2188#endif \ No newline at end of file 2197#endif
diff --git a/src/static_libs/vg_common/vg_common.c b/src/static_libs/vg_common/vg_common.c
index 4204c733f4..410588e6b7 100644
--- a/src/static_libs/vg_common/vg_common.c
+++ b/src/static_libs/vg_common/vg_common.c
@@ -554,6 +554,11 @@ _apply_gradient_property(Svg_Style_Gradient *g)
554 int stop_count = 0, i = 0; 554 int stop_count = 0, i = 0;
555 Eina_List *l; 555 Eina_List *l;
556 556
557 /*
558 if (!g->user_space)
559 //get bounding box
560 */
561
557 if (g->type == SVG_LINEAR_GRADIENT) 562 if (g->type == SVG_LINEAR_GRADIENT)
558 { 563 {
559 grad_obj = evas_vg_gradient_linear_add(NULL); 564 grad_obj = evas_vg_gradient_linear_add(NULL);
diff --git a/src/static_libs/vg_common/vg_common.h b/src/static_libs/vg_common/vg_common.h
index 70c744942e..65c70a89a9 100644
--- a/src/static_libs/vg_common/vg_common.h
+++ b/src/static_libs/vg_common/vg_common.h
@@ -182,6 +182,7 @@ struct _Svg_Style_Gradient
182 Eina_Stringshare *id; 182 Eina_Stringshare *id;
183 Eina_Stringshare *ref; 183 Eina_Stringshare *ref;
184 Efl_Gfx_Gradient_Spread spread; 184 Efl_Gfx_Gradient_Spread spread;
185 Eina_Bool user_space;
185 Eina_List *stops; // Efl_Gfx_Gradient_Stop 186 Eina_List *stops; // Efl_Gfx_Gradient_Stop
186 Svg_Radial_Gradient *radial; 187 Svg_Radial_Gradient *radial;
187 Svg_Linear_Gradient *linear; 188 Svg_Linear_Gradient *linear;