jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=b643dabc36bc1153467fc1b4a1fe8edfdc543cdd

commit b643dabc36bc1153467fc1b4a1fe8edfdc543cdd
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Tue Feb 10 18:18:05 2015 +0900

    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
---
 src/modules/evas/engines/gl_common/evas_gl_context.c | 14 ++++++++++----
 1 file 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 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;

-- 


Reply via email to