summaryrefslogtreecommitdiff
path: root/src/static_libs/vg_common/vg_common_json.c
diff options
context:
space:
mode:
authorHermet Park <hermetpark@gmail.com>2019-09-24 11:46:50 +0900
committerHermet Park <hermetpark@gmail.com>2019-09-24 11:49:10 +0900
commit44d362e1ef9f0ab1375dde2948fa0ba80ee935cf (patch)
tree495005c6d8b051af95d6747e6935cdd742004077 /src/static_libs/vg_common/vg_common_json.c
parent3b1f7bea75dc5e9753ace4e886174b4afdb0515a (diff)
evas vg: fix gradient stroke fill memory leaks.
There were continous creation of gradient objects, We can stop it by caching it properly, Also, fix mismatched ref/unref counts.
Diffstat (limited to '')
-rw-r--r--src/static_libs/vg_common/vg_common_json.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c
index 910a4055e1..3b3d114503 100644
--- a/src/static_libs/vg_common/vg_common_json.c
+++ b/src/static_libs/vg_common/vg_common_json.c
@@ -177,13 +177,25 @@ _construct_drawable_nodes(Efl_Canvas_Vg_Container *parent, const LOTLayerNode *l
177 177
178 if (node->mGradient.type == GradientLinear) 178 if (node->mGradient.type == GradientLinear)
179 { 179 {
180 grad = efl_add(EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS, parent); 180 char *key = _get_key_val(shape);
181 grad = efl_key_data_get(shape, key);
182 if (!grad)
183 {
184 grad = efl_add(EFL_CANVAS_VG_GRADIENT_LINEAR_CLASS, parent);
185 efl_key_data_set(shape, key, grad);
186 }
181 efl_gfx_gradient_linear_start_set(grad, node->mGradient.start.x, node->mGradient.start.y); 187 efl_gfx_gradient_linear_start_set(grad, node->mGradient.start.x, node->mGradient.start.y);
182 efl_gfx_gradient_linear_end_set(grad, node->mGradient.end.x, node->mGradient.end.y); 188 efl_gfx_gradient_linear_end_set(grad, node->mGradient.end.x, node->mGradient.end.y);
183 } 189 }
184 else if (node->mGradient.type == GradientRadial) 190 else if (node->mGradient.type == GradientRadial)
185 { 191 {
186 grad = efl_add(EFL_CANVAS_VG_GRADIENT_RADIAL_CLASS, parent); 192 char *key = _get_key_val(shape);
193 grad = efl_key_data_get(shape, key);
194 if (!grad)
195 {
196 grad = efl_add(EFL_CANVAS_VG_GRADIENT_RADIAL_CLASS, parent);
197 efl_key_data_set(shape, key, grad);
198 }
187 efl_gfx_gradient_radial_center_set(grad, node->mGradient.center.x, node->mGradient.center.y); 199 efl_gfx_gradient_radial_center_set(grad, node->mGradient.center.x, node->mGradient.center.y);
188 efl_gfx_gradient_radial_focal_set(grad, node->mGradient.focal.x, node->mGradient.focal.y); 200 efl_gfx_gradient_radial_focal_set(grad, node->mGradient.focal.x, node->mGradient.focal.y);
189 efl_gfx_gradient_radial_radius_set(grad, node->mGradient.cradius); 201 efl_gfx_gradient_radial_radius_set(grad, node->mGradient.cradius);