svg/loader: refactored the copy of structure.

Reviewers: cedric, jpeg, Hermet

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4137
This commit is contained in:
Subhransu Mohanty 2016-07-07 10:42:03 +09:00 committed by Hermet Park
parent 99018bcb5f
commit 18fd4453d0
1 changed files with 3 additions and 14 deletions

View File

@ -1281,11 +1281,7 @@ _clone_grad_stops(Eina_List *from)
Efl_Gfx_Gradient_Stop *new_stop;
new_stop = calloc(1, sizeof(Efl_Gfx_Gradient_Stop));
new_stop->r = stop->r;
new_stop->g = stop->g;
new_stop->b = stop->b;
new_stop->a = stop->a;
memcpy(new_stop, stop, sizeof(Efl_Gfx_Gradient_Stop));
res = eina_list_append(res, new_stop);
}
@ -1308,19 +1304,12 @@ _clone_gradient(Svg_Style_Gradient *from)
if (grad->type == SVG_LINEAR_GRADIENT)
{
grad->linear = calloc(1, sizeof(Svg_Linear_Gradient));
grad->linear->x1 = from->linear->x1;
grad->linear->y1 = from->linear->y1;
grad->linear->x2 = from->linear->x2;
grad->linear->y1 = from->linear->y2;
memcpy(grad->linear, from->linear, sizeof(Svg_Linear_Gradient));
}
else if (grad->type == SVG_RADIAL_GRADIENT)
{
grad->radial = calloc(1, sizeof(Svg_Radial_Gradient));
grad->radial->cx = from->radial->cx;
grad->radial->cy = from->radial->cy;
grad->radial->fx = from->radial->fx;
grad->radial->fy = from->radial->fy;
grad->radial->r = from->radial->r;
memcpy(grad->radial, from->radial, sizeof(Svg_Radial_Gradient));
}
return grad;