diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2015-02-10 18:18:05 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2015-02-10 18:18:05 +0900 |
commit | b643dabc36bc1153467fc1b4a1fe8edfdc543cdd (patch) | |
tree | c5b3a64baa5bbeaf5cbb6033e881911469ea3900 /src | |
parent | 2450a249e7c8bc41a8b7e101df2bed155dc58222 (diff) |
Evas masking: Force BLEND mode in case of image masking (GL)
This fixes some cases where the image has no alpha and COPY mode
is used, but a mask is also applied. In that case, masking
takes precedence and BLEND mode is used.
@fix
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/evas/engines/gl_common/evas_gl_context.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index bed567cda9..080ae2a4eb 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c | |||
@@ -1850,10 +1850,16 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc, | |||
1850 | Eina_Bool blend = EINA_FALSE; | 1850 | Eina_Bool blend = EINA_FALSE; |
1851 | Evas_GL_Shader shader = SHADER_IMG; | 1851 | Evas_GL_Shader shader = SHADER_IMG; |
1852 | GLuint prog = gc->shared->shader[shader].prog; | 1852 | GLuint prog = gc->shared->shader[shader].prog; |
1853 | int pn = 0, sam = 0; | 1853 | int pn = 0, sam = 0, render_op = gc->dc->render_op; |
1854 | 1854 | ||
1855 | if (!(gc->dc->render_op == EVAS_RENDER_COPY) && | 1855 | if (!!mtex) |
1856 | ((a < 255) || (tex->alpha) || (!!mtex))) blend = EINA_TRUE; | 1856 | { |
1857 | // masking forces BLEND mode (mask with COPY does not make sense) | ||
1858 | blend = EINA_TRUE; | ||
1859 | render_op = EVAS_RENDER_BLEND; | ||
1860 | } | ||
1861 | else if (!(render_op == EVAS_RENDER_COPY) && ((a < 255) || (tex->alpha))) | ||
1862 | blend = EINA_TRUE; | ||
1857 | 1863 | ||
1858 | if (tex_only) | 1864 | if (tex_only) |
1859 | { | 1865 | { |
@@ -2050,7 +2056,7 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc, | |||
2050 | gc->pipe[pn].shader.cur_prog = prog; | 2056 | gc->pipe[pn].shader.cur_prog = prog; |
2051 | gc->pipe[pn].shader.smooth = smooth; | 2057 | gc->pipe[pn].shader.smooth = smooth; |
2052 | gc->pipe[pn].shader.blend = blend; | 2058 | gc->pipe[pn].shader.blend = blend; |
2053 | gc->pipe[pn].shader.render_op = gc->dc->render_op; | 2059 | gc->pipe[pn].shader.render_op = render_op; |
2054 | gc->pipe[pn].shader.clip = 0; | 2060 | gc->pipe[pn].shader.clip = 0; |
2055 | gc->pipe[pn].shader.cx = 0; | 2061 | gc->pipe[pn].shader.cx = 0; |
2056 | gc->pipe[pn].shader.cy = 0; | 2062 | gc->pipe[pn].shader.cy = 0; |