summaryrefslogtreecommitdiff
path: root/src/static_libs
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2019-07-17 17:15:23 +0900
committerHermet Park <hermetpark@gmail.com>2019-07-17 17:15:23 +0900
commitbaf1fcdb916d0142e1d0652549d658751486a534 (patch)
treef6ce85da81fb0eb793e7fd981cbad4521ad4b996 /src/static_libs
parentb25c9f613728c478590f6d7e97e5bcdc5f6e5472 (diff)
vg_common_svg: Gradient stop color use premultiplied color.
Summary: The parsed color is straight color. evas use premultiplied color. Test Plan: Sample SVG <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"> <defs> <linearGradient id="linearGradient1" x1="0" y1="0" x2="0.2" y2="0.2" spreadMethod="reflect"> <stop style="stop-color:#ff0000;stop-opacity:1;" offset="0"/> <stop style="stop-color:#0000ff;stop-opacity:1;" offset="1"/> </linearGradient> <radialGradient id="radialGradient222" r="0.2" cx="0.3" cy="0.3" spreadMethod="reflect"> <stop style="stop-color:#ffFF00;stop-opacity:0.1;" offset="0"/> <stop style="stop-color:#00FFff;stop-opacity:1;" offset="1"/> </radialGradient> <radialGradient id="radialGradient333" r="0.2" cx="0.3" cy="0.3" spreadMethod="reflect"> <stop style="stop-color:#00FF00;stop-opacity:0.1;" offset="0"/> <stop style="stop-color:#FF00ff;stop-opacity:1;" offset="1"/> </radialGradient> </defs> <rect x="0" y="0" width="100" height="100" fill="url(#linearGradient1)"/> <rect x="50" y="50" width="50" height="50" fill="url(#radialGradient222)"/> <rect x="0" y="0" width="50" height="50" fill="url(#radialGradient333)"/> </svg> Reviewers: Hermet, kimcinoo, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9338
Diffstat (limited to 'src/static_libs')
-rw-r--r--src/static_libs/vg_common/vg_common_svg.c9
1 files 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
683 stop_count = eina_list_count(g->stops); 683 stop_count = eina_list_count(g->stops);
684 if (stop_count) 684 if (stop_count)
685 { 685 {
686 double opacity;
686 stops = calloc(stop_count, sizeof(Efl_Gfx_Gradient_Stop)); 687 stops = calloc(stop_count, sizeof(Efl_Gfx_Gradient_Stop));
687 i = 0; 688 i = 0;
688 EINA_LIST_FOREACH(g->stops, l, stop) 689 EINA_LIST_FOREACH(g->stops, l, stop)
689 { 690 {
690 stops[i].r = stop->r; 691 // Use premultiplied color
691 stops[i].g = stop->g; 692 opacity = (double)stop->a / 255;
692 stops[i].b = stop->b; 693 stops[i].r = stop->r * opacity;
694 stops[i].g = stop->g * opacity;
695 stops[i].b = stop->b * opacity;
693 stops[i].a = stop->a; 696 stops[i].a = stop->a;
694 stops[i].offset = stop->offset; 697 stops[i].offset = stop->offset;
695 i++; 698 i++;