jpeg pushed a commit to branch master.

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

commit 73b16a49621d9cf33767ec7634e6e6fd884f3e9d
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Fri Feb 6 12:31:24 2015 +0900

    Evas masking: Also fix map masking with non-bgra images
---
 src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x | 4 ++--
 src/modules/evas/engines/gl_common/shader/map_mask_vert.shd | 9 ++++++---
 2 files changed, 8 insertions(+), 5 deletions(-)

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 3a32e09..2264f5c 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
@@ -2733,7 +2733,7 @@ static const char const map_mask_vert_glsl[] =
    "precision highp float;\n"
    "#endif\n"
    "attribute vec4 vertex, color;\n"
-   "attribute vec2 tex_coord, tex_coordm, tex_sample;\n"
+   "attribute vec2 tex_coord, tex_coordm, tex_sample, tex_coorda;\n"
    "uniform mat4 mvp;\n"
    "varying vec2 tex_c;\n"
    "varying vec4 mask_Position, col, mask_Absolute;\n"
@@ -2743,7 +2743,7 @@ static const char const map_mask_vert_glsl[] =
    "   tex_c = tex_coord;\n"
    "   col = color;\n"
    "   // Assume Y-invert on mask, normalize (screen to texture mode 
coordinates)\n"
-   "   mask_Position = mvp * vertex * vec4(0.5, -0.5, 0.5, 0.5) + vec4(0.5, 
0.5, 0, 0);\n"
+   "   mask_Position = mvp * vertex * vec4(0.5, tex_coorda.y * 0.5, 0.5, 0.5) 
+ vec4(0.5, 0.5, 0, 0);\n"
    "   mask_Absolute = vec4(tex_coordm, tex_sample); // x, y, 1/w, 1/h on 
canvas in GL coords\n"
    "}\n";
 Evas_GL_Program_Source shader_map_mask_vert_src =
diff --git a/src/modules/evas/engines/gl_common/shader/map_mask_vert.shd 
b/src/modules/evas/engines/gl_common/shader/map_mask_vert.shd
index a7a537d..7b0c968 100644
--- a/src/modules/evas/engines/gl_common/shader/map_mask_vert.shd
+++ b/src/modules/evas/engines/gl_common/shader/map_mask_vert.shd
@@ -2,7 +2,7 @@
 precision highp float;
 #endif
 attribute vec4 vertex, color;
-attribute vec2 tex_coord, tex_coordm, tex_sample;
+attribute vec2 tex_coord, tex_coordm, tex_sample, tex_coorda;
 uniform mat4 mvp;
 varying vec2 tex_c;
 varying vec4 mask_Position, col, mask_Absolute;
@@ -12,7 +12,10 @@ void main()
    tex_c = tex_coord;
    col = color;
 
-   // Assume Y-invert on mask, normalize (screen to texture mode coordinates)
-   mask_Position = mvp * vertex * vec4(0.5, -0.5, 0.5, 0.5) + vec4(0.5, 0.5, 
0, 0);
+   // tex_coorda contains the Y-invert flag
+   // tex_coordm contains the X,Y position of the mask
+   // tex_sample contains the W,H size of the mask (inverted)
+
+   mask_Position = mvp * vertex * vec4(tex_coorda.x * 0.5, tex_coorda.y * 0.5, 
0.5, 0.5) + vec4(0.5, 0.5, 0, 0);
    mask_Absolute = vec4(tex_coordm, tex_sample); // x, y, 1/w, 1/h on canvas 
in GL coords
 }

-- 


Reply via email to