aboutsummaryrefslogtreecommitdiffstats
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
parentefl_gfx_path: fix typo in _path_bounds_get (diff)
downloadefl-fac649c7f41c148ac4750c626bf93a5fd9b4ae49.tar.gz
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)
grad->id = _copy_id(from->id);
grad->ref = _copy_id(from->ref);
grad->spread = from->spread;
+ grad->user_space = from->user_space;
grad->stops = _clone_grad_stops(from->stops);
if (grad->type == SVG_LINEAR_GRADIENT)
{
@@ -1659,6 +1660,10 @@ _attr_parse_radial_gradient_node(void *data, const char *key, const char *value)
{
grad->ref = _id_from_href(value);
}
+ else if (!strcmp(key, "gradientUnits") && !strcmp(value, "userSpaceOnUse"))
+ {
+ grad->user_space = EINA_TRUE;
+ }
return EINA_TRUE;
}
@@ -1777,6 +1782,10 @@ _attr_parse_linear_gradient_node(void *data, const char *key, const char *value)
{
grad->ref = _id_from_href(value);
}
+ else if (!strcmp(key, "gradientUnits") && !strcmp(value, "userSpaceOnUse"))
+ {
+ grad->user_space = EINA_TRUE;
+ }
return EINA_TRUE;
}
@@ -2185,4 +2194,4 @@ EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_VG_LOADER, vg_loader, svg);
#ifndef EVAS_STATIC_BUILD_VG_SVG
EVAS_EINA_MODULE_DEFINE(vg_loader, svg);
-#endif \ No newline at end of file
+#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)
int stop_count = 0, i = 0;
Eina_List *l;
+ /*
+ if (!g->user_space)
+ //get bounding box
+ */
+
if (g->type == SVG_LINEAR_GRADIENT)
{
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
Eina_Stringshare *id;
Eina_Stringshare *ref;
Efl_Gfx_Gradient_Spread spread;
+ Eina_Bool user_space;
Eina_List *stops; // Efl_Gfx_Gradient_Stop
Svg_Radial_Gradient *radial;
Svg_Linear_Gradient *linear;