};
#ifdef HAVE_THORVG
-
static inline double
_interpolate(double from, double to, double pos_map)
{
sd->cmd_prev = c_prev;
}
-
static void
_append_scubic_to(Evas_Vg_Shape *obj, double x, double y,
double ctrl_x1, double ctrl_y1)
if (sd->shape) tvg_paint_del(sd->shape);
sd->shape = tvg_paint_duplicate(sd_from->shape);
+ if (sd_from->fill)
+ {
+ Efl_Canvas_Vg_Gradient_Data *gd = NULL;
+ Tvg_Gradient *grad = NULL;
+ sd->fill = efl_duplicate(sd_from->fill);
+ tvg_shape_get_gradient(sd_from->shape, &grad);
+ gd = efl_data_scope_get(sd->fill, EFL_CANVAS_VG_GRADIENT_CLASS);
+ if (gd) gd->gradient = grad;
+ }
+
sd->curr_ctrl.x = sd_from->curr_ctrl.x;
sd->curr_ctrl.y = sd_from->curr_ctrl.y;
Efl_Canvas_Vg_Node *f)
{
if (pd->fill == f) return;
-#ifdef HAVE_THORVG
+
if (efl_isa(pd->fill, EFL_CANVAS_VG_GRADIENT_CLASS))
{
efl_del(pd->fill);
pd->fill = NULL;
}
-#endif
+
Efl_Canvas_Vg_Node *tmp = pd->fill;
pd->fill = efl_ref(f);
efl_unref(tmp);
+
+#ifdef HAVE_THORVG
+ Efl_Canvas_Vg_Gradient_Data *gd = NULL;
+ gd = efl_data_scope_get(pd->fill, EFL_CANVAS_VG_GRADIENT_CLASS);
+
+ if (efl_isa(pd->fill, EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS))
+ tvg_shape_set_linear_gradient(pd->shape, gd->gradient);
+ else if (efl_isa(pd->fill, EFL_CANVAS_VG_GRADIENT_RADIAL_CLASS))
+ tvg_shape_set_radial_gradient(pd->shape, gd->gradient);
+#endif
}
static Efl_Canvas_Vg_Node *
void *canvas)
{
Efl_Canvas_Vg_Shape_Data *sd = NULL;
- Efl_Canvas_Vg_Gradient_Data *gd = NULL;
Tvg_Matrix trans_mat = { 0 };
const Eina_Matrix3 *m = NULL;
nd->flags = EFL_GFX_CHANGE_FLAG_NONE;
tvg_paint_translate(sd->shape, nd->x, nd->y);
- // set color fill
- if (sd->fill != NULL && efl_isa(sd->fill, EFL_CANVAS_VG_GRADIENT_CLASS))
+ if (sd->fill == NULL)
{
- gd = efl_data_scope_get(sd->fill, EFL_CANVAS_VG_GRADIENT_CLASS);
- gd->shape = obj;
- gd->gradient_render_pre_tvg(sd->fill, gd, sd->shape);
+ efl_gfx_color_get(obj, &r, &g, &b, &a);
+ tvg_shape_set_fill_color(sd->shape, r, g, b, a);
}
m = evas_vg_node_transformation_get(obj);