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[] = "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 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 @@ 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 }