From 69fddc837fbb910f5cd4fb44d17c86287d67fd26 Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Wed, 17 Jul 2019 17:15:23 +0900 Subject: [PATCH] vg_common_svg: Gradient stop color use premultiplied color. Summary: The parsed color is straight color. evas use premultiplied color. Test Plan: Sample SVG Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9338 Change-Id: Ifcc1d6b94aab190494afa4f1800e2ed7cf2ffaed --- src/static_libs/vg_common/vg_common_svg.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/static_libs/vg_common/vg_common_svg.c b/src/static_libs/vg_common/vg_common_svg.c index 20a167c..e3866e2 100644 --- a/src/static_libs/vg_common/vg_common_svg.c +++ b/src/static_libs/vg_common/vg_common_svg.c @@ -683,13 +683,16 @@ _apply_gradient_property(Svg_Style_Gradient *g, Efl_VG *vg, Efl_VG *parent, Vg_F stop_count = eina_list_count(g->stops); if (stop_count) { + double opacity; stops = calloc(stop_count, sizeof(Efl_Gfx_Gradient_Stop)); i = 0; EINA_LIST_FOREACH(g->stops, l, stop) { - stops[i].r = stop->r; - stops[i].g = stop->g; - stops[i].b = stop->b; + // Use premultiplied color + opacity = (double)stop->a / 255; + stops[i].r = stop->r * opacity; + stops[i].g = stop->g * opacity; + stops[i].b = stop->b * opacity; stops[i].a = stop->a; stops[i].offset = stop->offset; i++; -- 2.7.4