jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=fac649c7f41c148ac4750c626bf93a5fd9b4ae49

commit fac649c7f41c148ac4750c626bf93a5fd9b4ae49
Author: Vitalii Vorobiov <[email protected]>
Date:   Tue Feb 14 17:37:27 2017 +0200

    vg_common: parse and store userSpaceOnUse (for gradient) when it is set
    
    So it can be calculated during the draw later on
---
 src/modules/evas/vg_loaders/svg/evas_vg_load_svg.c | 11 ++++++++++-
 src/static_libs/vg_common/vg_common.c              |  5 +++++
 src/static_libs/vg_common/vg_common.h              |  1 +
 3 files changed, 16 insertions(+), 1 deletion(-)

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;

-- 


Reply via email to