summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-02-06 12:31:24 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-02-06 12:33:29 +0900
commit73b16a49621d9cf33767ec7634e6e6fd884f3e9d (patch)
treee2bb85b39653869945d328c398e75f7785332ca3 /src/modules
parent92954b707cea25c28e6b71cf0d09463b0307135a (diff)
Evas masking: Also fix map masking with non-bgra images
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x4
-rw-r--r--src/modules/evas/engines/gl_common/shader/map_mask_vert.shd9
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 3a32e0933f..2264f5c75e 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[] =
2733 "precision highp float;\n" 2733 "precision highp float;\n"
2734 "#endif\n" 2734 "#endif\n"
2735 "attribute vec4 vertex, color;\n" 2735 "attribute vec4 vertex, color;\n"
2736 "attribute vec2 tex_coord, tex_coordm, tex_sample;\n" 2736 "attribute vec2 tex_coord, tex_coordm, tex_sample, tex_coorda;\n"
2737 "uniform mat4 mvp;\n" 2737 "uniform mat4 mvp;\n"
2738 "varying vec2 tex_c;\n" 2738 "varying vec2 tex_c;\n"
2739 "varying vec4 mask_Position, col, mask_Absolute;\n" 2739 "varying vec4 mask_Position, col, mask_Absolute;\n"
@@ -2743,7 +2743,7 @@ static const char const map_mask_vert_glsl[] =
2743 " tex_c = tex_coord;\n" 2743 " tex_c = tex_coord;\n"
2744 " col = color;\n" 2744 " col = color;\n"
2745 " // Assume Y-invert on mask, normalize (screen to texture mode coordinates)\n" 2745 " // Assume Y-invert on mask, normalize (screen to texture mode coordinates)\n"
2746 " mask_Position = mvp * vertex * vec4(0.5, -0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n" 2746 " mask_Position = mvp * vertex * vec4(0.5, tex_coorda.y * 0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0);\n"
2747 " mask_Absolute = vec4(tex_coordm, tex_sample); // x, y, 1/w, 1/h on canvas in GL coords\n" 2747 " mask_Absolute = vec4(tex_coordm, tex_sample); // x, y, 1/w, 1/h on canvas in GL coords\n"
2748 "}\n"; 2748 "}\n";
2749Evas_GL_Program_Source shader_map_mask_vert_src = 2749Evas_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 a7a537d26b..7b0c9684e7 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 @@
2precision highp float; 2precision highp float;
3#endif 3#endif
4attribute vec4 vertex, color; 4attribute vec4 vertex, color;
5attribute vec2 tex_coord, tex_coordm, tex_sample; 5attribute vec2 tex_coord, tex_coordm, tex_sample, tex_coorda;
6uniform mat4 mvp; 6uniform mat4 mvp;
7varying vec2 tex_c; 7varying vec2 tex_c;
8varying vec4 mask_Position, col, mask_Absolute; 8varying vec4 mask_Position, col, mask_Absolute;
@@ -12,7 +12,10 @@ void main()
12 tex_c = tex_coord; 12 tex_c = tex_coord;
13 col = color; 13 col = color;
14 14
15 // Assume Y-invert on mask, normalize (screen to texture mode coordinates) 15 // tex_coorda contains the Y-invert flag
16 mask_Position = mvp * vertex * vec4(0.5, -0.5, 0.5, 0.5) + vec4(0.5, 0.5, 0, 0); 16 // tex_coordm contains the X,Y position of the mask
17 // tex_sample contains the W,H size of the mask (inverted)
18
19 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);
17 mask_Absolute = vec4(tex_coordm, tex_sample); // x, y, 1/w, 1/h on canvas in GL coords 20 mask_Absolute = vec4(tex_coordm, tex_sample); // x, y, 1/w, 1/h on canvas in GL coords
18} 21}