From: Mira Grudzinska Date: Sun, 21 Mar 2021 16:38:09 +0000 (+0100) Subject: vg_common_svg: colors unpremultiplication added before saving into edj file X-Git-Tag: accepted/tizen/unified/20210330.111316~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F27%2F255627%2F2;p=platform%2Fupstream%2Fefl.git vg_common_svg: colors unpremultiplication added before saving into edj file Colors were premultiplied first when reading from the svg file and second when saving into edj file. As the result svg files with the opacity < 1 could be uncorretly displayed (only when the color and the opacity were given in the same node). Change-Id: If4bc806a88993fdb3ca8a7c78b2a574215cb71f5 --- diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index 7852daa..e6f0223 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -1056,6 +1056,7 @@ _create_gradient_node(Efl_VG *vg) new_stop = calloc(1, sizeof(Evas_Vg_Gradient_Stop)); if (!new_stop) goto oom_error; memcpy(new_stop, stops, sizeof(Evas_Vg_Gradient_Stop)); + evas_color_argb_unpremul(new_stop->a, &new_stop->r, &new_stop->g, &new_stop->b); grad->stops = eina_list_append(grad->stops, new_stop); stops++; } @@ -1130,6 +1131,7 @@ _apply_svg_property(Svg_Node *node, Efl_VG *vg) { evas_vg_node_color_get(vg, &style->fill.paint.r, &style->fill.paint.g, &style->fill.paint.b, &style->fill.opacity); + evas_color_argb_unpremul(style->fill.opacity, &style->fill.paint.r, &style->fill.paint.g, &style->fill.paint.b); } // apply stroke style property @@ -1145,6 +1147,7 @@ _apply_svg_property(Svg_Node *node, Efl_VG *vg) // apply the stroke color evas_vg_shape_stroke_color_get(vg, &style->stroke.paint.r, &style->stroke.paint.g, &style->stroke.paint.b, &style->stroke.opacity); + evas_color_argb_unpremul(style->stroke.opacity, &style->stroke.paint.r, &style->stroke.paint.g, &style->stroke.paint.b); } style->stroke.width = evas_vg_shape_stroke_width_get(vg);