From: Jean-Philippe Andre Date: Tue, 10 Feb 2015 09:18:05 +0000 (+0900) Subject: Evas masking: Force BLEND mode in case of image masking (GL) X-Git-Tag: v1.14.0-alpha1~550 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b643dabc36bc1153467fc1b4a1fe8edfdc543cdd;p=platform%2Fupstream%2Fefl.git 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 --- 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 bed567c..080ae2a 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, Eina_Bool blend = EINA_FALSE; Evas_GL_Shader shader = SHADER_IMG; GLuint prog = gc->shared->shader[shader].prog; - int pn = 0, sam = 0; + int pn = 0, sam = 0, render_op = gc->dc->render_op; - if (!(gc->dc->render_op == EVAS_RENDER_COPY) && - ((a < 255) || (tex->alpha) || (!!mtex))) blend = EINA_TRUE; + if (!!mtex) + { + // masking forces BLEND mode (mask with COPY does not make sense) + blend = EINA_TRUE; + render_op = EVAS_RENDER_BLEND; + } + else if (!(render_op == EVAS_RENDER_COPY) && ((a < 255) || (tex->alpha))) + blend = EINA_TRUE; if (tex_only) { @@ -2050,7 +2056,7 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc, gc->pipe[pn].shader.cur_prog = prog; gc->pipe[pn].shader.smooth = smooth; gc->pipe[pn].shader.blend = blend; - gc->pipe[pn].shader.render_op = gc->dc->render_op; + gc->pipe[pn].shader.render_op = render_op; gc->pipe[pn].shader.clip = 0; gc->pipe[pn].shader.cx = 0; gc->pipe[pn].shader.cy = 0;