forked from enlightenment/efl
Evas: Actually fix this 'afill' thing
This mostly reverts 448720fed4
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...
This commit is contained in:
parent
448720fed4
commit
bee4e5f476
|
@ -646,7 +646,7 @@ evas_gl_common_shader_flags_get(Evas_GL_Shared *shared, Shader_Type type,
|
|||
Shader_Sampling *psam, int *pnomul, Shader_Sampling *pmasksam)
|
||||
{
|
||||
Shader_Sampling sam = SHD_SAM11, masksam = SHD_SAM11;
|
||||
int nomul = 1, bgra = 0, k, noalpha = 1;
|
||||
int nomul = 1, bgra = 0, k;
|
||||
unsigned int flags = BASEFLAG;
|
||||
|
||||
// image downscale sampling
|
||||
|
@ -717,17 +717,12 @@ evas_gl_common_shader_flags_get(Evas_GL_Shared *shared, Shader_Type type,
|
|||
if (map_points[k].col != 0xffffffff)
|
||||
{
|
||||
nomul = 0;
|
||||
if (A_VAL(&map_points[k].col) < 255)
|
||||
noalpha = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (a < 255)
|
||||
noalpha = 0;
|
||||
nomul = 0;
|
||||
}
|
||||
|
||||
if (nomul)
|
||||
flags |= SHADER_FLAG_NOMUL;
|
||||
|
@ -746,7 +741,7 @@ evas_gl_common_shader_flags_get(Evas_GL_Shared *shared, Shader_Type type,
|
|||
if (tex)
|
||||
{
|
||||
flags |= SHADER_FLAG_TEX;
|
||||
if (!tex->alpha && !mtex && noalpha)
|
||||
if (!tex->alpha)
|
||||
flags |= SHADER_FLAG_AFILL;
|
||||
}
|
||||
|
||||
|
|
|
@ -146,6 +146,9 @@ static const char fragment_glsl[] =
|
|||
" ma = texture2D(texm, tex_m).a;\n"
|
||||
"# endif\n"
|
||||
"#endif\n"
|
||||
"#ifdef SHD_AFILL\n"
|
||||
" c.a = 1.0;\n"
|
||||
"#endif\n"
|
||||
" gl_FragColor =\n"
|
||||
" c\n"
|
||||
"#ifndef SHD_NOMUL\n"
|
||||
|
@ -158,9 +161,6 @@ static const char fragment_glsl[] =
|
|||
" * texture2D(texa, tex_a).r\n"
|
||||
"#endif\n"
|
||||
" ;\n"
|
||||
"#ifdef SHD_AFILL\n"
|
||||
" gl_FragColor.a = 1.0;\n"
|
||||
"#endif\n"
|
||||
"}\n";
|
||||
|
||||
static const char vertex_glsl[] =
|
||||
|
|
|
@ -148,6 +148,10 @@ void main()
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef SHD_AFILL
|
||||
c.a = 1.0;
|
||||
#endif
|
||||
|
||||
gl_FragColor =
|
||||
c
|
||||
#ifndef SHD_NOMUL
|
||||
|
@ -160,9 +164,5 @@ void main()
|
|||
* texture2D(texa, tex_a).r
|
||||
#endif
|
||||
;
|
||||
|
||||
#ifdef SHD_AFILL
|
||||
gl_FragColor.a = 1.0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue