summaryrefslogtreecommitdiff
path: root/src/modules/evas
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-01-20 17:28:49 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-01-20 17:37:51 +0900
commitbee4e5f47692b2c32f5e071b57651e298bb78516 (patch)
treea810b1123a0bb1dded5e6b728fc3ae95053b0e04 /src/modules/evas
parent448720fed4da252fa5eefa02ae37c79c5fb63499 (diff)
Evas: Actually fix this 'afill' thing
This mostly reverts 448720fed4da252fa5eefa02ae37c79c5fb63499 After my previous patch, semi-transparent windows would render incorrectly in E. The AFILL flag should make sure the source texture is "opaque" (ie. if it's not marked as having an alpha channel), and masking or color multiply should then be applied later on. Sorry for the mess...
Diffstat (limited to 'src/modules/evas')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_shader.c13
-rw-r--r--src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x6
-rw-r--r--src/modules/evas/engines/gl_common/shader/fragment.glsl8
3 files changed, 11 insertions, 16 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_shader.c b/src/modules/evas/engines/gl_common/evas_gl_shader.c
index 0590e17a17..c049d9e609 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_shader.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_shader.c
@@ -646,7 +646,7 @@ evas_gl_common_shader_flags_get(Evas_GL_Shared *shared, Shader_Type type,
646 Shader_Sampling *psam, int *pnomul, Shader_Sampling *pmasksam) 646 Shader_Sampling *psam, int *pnomul, Shader_Sampling *pmasksam)
647{ 647{
648 Shader_Sampling sam = SHD_SAM11, masksam = SHD_SAM11; 648 Shader_Sampling sam = SHD_SAM11, masksam = SHD_SAM11;
649 int nomul = 1, bgra = 0, k, noalpha = 1; 649 int nomul = 1, bgra = 0, k;
650 unsigned int flags = BASEFLAG; 650 unsigned int flags = BASEFLAG;
651 651
652 // image downscale sampling 652 // image downscale sampling
@@ -717,17 +717,12 @@ evas_gl_common_shader_flags_get(Evas_GL_Shared *shared, Shader_Type type,
717 if (map_points[k].col != 0xffffffff) 717 if (map_points[k].col != 0xffffffff)
718 { 718 {
719 nomul = 0; 719 nomul = 0;
720 if (A_VAL(&map_points[k].col) < 255) 720 break;
721 noalpha = 0;
722 } 721 }
723 } 722 }
724 } 723 }
725 else 724 else
726 { 725 nomul = 0;
727 if (a < 255)
728 noalpha = 0;
729 nomul = 0;
730 }
731 726
732 if (nomul) 727 if (nomul)
733 flags |= SHADER_FLAG_NOMUL; 728 flags |= SHADER_FLAG_NOMUL;
@@ -746,7 +741,7 @@ evas_gl_common_shader_flags_get(Evas_GL_Shared *shared, Shader_Type type,
746 if (tex) 741 if (tex)
747 { 742 {
748 flags |= SHADER_FLAG_TEX; 743 flags |= SHADER_FLAG_TEX;
749 if (!tex->alpha && !mtex && noalpha) 744 if (!tex->alpha)
750 flags |= SHADER_FLAG_AFILL; 745 flags |= SHADER_FLAG_AFILL;
751 } 746 }
752 747
diff --git a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x b/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x
index a0132aa79a..558531a50b 100644
--- a/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x
+++ b/src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x
@@ -146,6 +146,9 @@ static const char fragment_glsl[] =
146 " ma = texture2D(texm, tex_m).a;\n" 146 " ma = texture2D(texm, tex_m).a;\n"
147 "# endif\n" 147 "# endif\n"
148 "#endif\n" 148 "#endif\n"
149 "#ifdef SHD_AFILL\n"
150 " c.a = 1.0;\n"
151 "#endif\n"
149 " gl_FragColor =\n" 152 " gl_FragColor =\n"
150 " c\n" 153 " c\n"
151 "#ifndef SHD_NOMUL\n" 154 "#ifndef SHD_NOMUL\n"
@@ -158,9 +161,6 @@ static const char fragment_glsl[] =
158 " * texture2D(texa, tex_a).r\n" 161 " * texture2D(texa, tex_a).r\n"
159 "#endif\n" 162 "#endif\n"
160 " ;\n" 163 " ;\n"
161 "#ifdef SHD_AFILL\n"
162 " gl_FragColor.a = 1.0;\n"
163 "#endif\n"
164 "}\n"; 164 "}\n";
165 165
166static const char vertex_glsl[] = 166static const char vertex_glsl[] =
diff --git a/src/modules/evas/engines/gl_common/shader/fragment.glsl b/src/modules/evas/engines/gl_common/shader/fragment.glsl
index baa22e3350..b534961300 100644
--- a/src/modules/evas/engines/gl_common/shader/fragment.glsl
+++ b/src/modules/evas/engines/gl_common/shader/fragment.glsl
@@ -148,6 +148,10 @@ void main()
148# endif 148# endif
149#endif 149#endif
150 150
151#ifdef SHD_AFILL
152 c.a = 1.0;
153#endif
154
151 gl_FragColor = 155 gl_FragColor =
152 c 156 c
153#ifndef SHD_NOMUL 157#ifndef SHD_NOMUL
@@ -160,9 +164,5 @@ void main()
160 * texture2D(texa, tex_a).r 164 * texture2D(texa, tex_a).r
161#endif 165#endif
162 ; 166 ;
163
164#ifdef SHD_AFILL
165 gl_FragColor.a = 1.0;
166#endif
167} 167}
168 168