From 9ec8064638be9a8abc779fc40267fea7de0598f3 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 14 Apr 2013 01:12:35 +0900 Subject: [PATCH] Work around new intel Mesa/xorg bug where alpha channel in NON-ARGB windows is not filled in with 0xff even if all the code does things right. --- ChangeLog | 6 + NEWS | 1 + src/Makefile_Evas.am | 16 ++ .../evas/engines/gl_common/evas_gl_common.h | 8 + .../evas/engines/gl_common/evas_gl_context.c | 32 +++- .../evas/engines/gl_common/evas_gl_shader.c | 160 ++++++++++++++++++ .../evas/engines/gl_common/shader/compile.sh | 8 + .../gl_common/shader/tex_12_afill_frag.h | 19 +++ .../gl_common/shader/tex_12_afill_frag.shd | 19 +++ .../gl_common/shader/tex_12_afill_vert.h | 21 +++ .../gl_common/shader/tex_12_afill_vert.shd | 21 +++ .../shader/tex_12_nomul_afill_frag.h | 18 ++ .../shader/tex_12_nomul_afill_frag.shd | 18 ++ .../shader/tex_12_nomul_afill_vert.h | 18 ++ .../shader/tex_12_nomul_afill_vert.shd | 18 ++ .../gl_common/shader/tex_21_afill_frag.h | 19 +++ .../gl_common/shader/tex_21_afill_frag.shd | 19 +++ .../gl_common/shader/tex_21_afill_vert.h | 21 +++ .../gl_common/shader/tex_21_afill_vert.shd | 21 +++ .../shader/tex_21_nomul_afill_frag.h | 18 ++ .../shader/tex_21_nomul_afill_frag.shd | 18 ++ .../shader/tex_21_nomul_afill_vert.h | 18 ++ .../shader/tex_21_nomul_afill_vert.shd | 18 ++ .../gl_common/shader/tex_22_afill_frag.h | 21 +++ .../gl_common/shader/tex_22_afill_frag.shd | 21 +++ .../gl_common/shader/tex_22_afill_vert.h | 23 +++ .../gl_common/shader/tex_22_afill_vert.shd | 23 +++ .../shader/tex_22_nomul_afill_frag.h | 20 +++ .../shader/tex_22_nomul_afill_frag.shd | 20 +++ .../shader/tex_22_nomul_afill_vert.h | 20 +++ .../shader/tex_22_nomul_afill_vert.shd | 20 +++ .../engines/gl_common/shader/tex_afill_frag.h | 15 ++ .../gl_common/shader/tex_afill_frag.shd | 15 ++ .../engines/gl_common/shader/tex_afill_vert.h | 15 ++ .../gl_common/shader/tex_afill_vert.shd | 15 ++ .../gl_common/shader/tex_nomul_afill_frag.h | 14 ++ .../gl_common/shader/tex_nomul_afill_frag.shd | 14 ++ .../gl_common/shader/tex_nomul_afill_vert.h | 12 ++ .../gl_common/shader/tex_nomul_afill_vert.shd | 12 ++ 39 files changed, 807 insertions(+), 8 deletions(-) create mode 100644 src/modules/evas/engines/gl_common/shader/tex_12_afill_frag.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_12_afill_frag.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_12_afill_vert.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_12_afill_vert.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_frag.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_frag.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_vert.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_vert.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_21_afill_frag.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_21_afill_frag.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_21_afill_vert.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_21_afill_vert.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_frag.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_frag.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_vert.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_vert.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_22_afill_frag.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_22_afill_frag.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_22_afill_vert.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_22_afill_vert.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_frag.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_frag.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_vert.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_vert.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_afill_frag.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_afill_frag.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_afill_vert.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_afill_vert.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_nomul_afill_frag.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_nomul_afill_frag.shd create mode 100644 src/modules/evas/engines/gl_common/shader/tex_nomul_afill_vert.h create mode 100644 src/modules/evas/engines/gl_common/shader/tex_nomul_afill_vert.shd diff --git a/ChangeLog b/ChangeLog index a7c165df47..463da60cfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-04-14 Carsten Haitzler (The Rasterman) + + * Evas: Work around new intel Mesa/xorg bug where alpha + channel in NON-ARGB windows is not filled in with 0xff even if all the + code does things right. + 2013-04-13 ChunEon Park * Evas: Don't be crashed even if the map image size is 0. diff --git a/NEWS b/NEWS index 17d5993131..dd591e29e5 100644 --- a/NEWS +++ b/NEWS @@ -149,6 +149,7 @@ Improvements: * Edje: use Eina_Cow to reduce memory usage. * Embryo: use eina_file_mkstemp(). * Evas textblock : Added split cursor for BiDi text + * Evas works around MESA/intel xorg bug where alpha channel of non-argb windows is not filled in with 0xff. Fixes: * Fix a memory leak in ecore_con_dns when using ecore_con_server_connect diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index fda1fef868..ae87ce7a35 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -501,6 +501,22 @@ modules/evas/engines/gl_common/shader/tex_frag.h \ modules/evas/engines/gl_common/shader/tex_nomul_frag.h \ modules/evas/engines/gl_common/shader/tex_nomul_vert.h \ modules/evas/engines/gl_common/shader/tex_vert.h \ +modules/evas/engines/gl_common/shader/tex_12_afill_frag.h \ +modules/evas/engines/gl_common/shader/tex_12_nomul_afill_frag.h \ +modules/evas/engines/gl_common/shader/tex_12_nomul_afill_vert.h \ +modules/evas/engines/gl_common/shader/tex_12_afill_vert.h \ +modules/evas/engines/gl_common/shader/tex_21_afill_frag.h \ +modules/evas/engines/gl_common/shader/tex_21_nomul_afill_frag.h \ +modules/evas/engines/gl_common/shader/tex_21_nomul_afill_vert.h \ +modules/evas/engines/gl_common/shader/tex_21_afill_vert.h \ +modules/evas/engines/gl_common/shader/tex_22_afill_frag.h \ +modules/evas/engines/gl_common/shader/tex_22_nomul_afill_frag.h \ +modules/evas/engines/gl_common/shader/tex_22_nomul_afill_vert.h \ +modules/evas/engines/gl_common/shader/tex_22_afill_vert.h \ +modules/evas/engines/gl_common/shader/tex_afill_frag.h \ +modules/evas/engines/gl_common/shader/tex_nomul_afill_frag.h \ +modules/evas/engines/gl_common/shader/tex_nomul_afill_vert.h \ +modules/evas/engines/gl_common/shader/tex_afill_vert.h \ modules/evas/engines/gl_common/shader/yuv_frag.h \ modules/evas/engines/gl_common/shader/yuv_nomul_frag.h \ modules/evas/engines/gl_common/shader/yuv_nomul_vert.h \ diff --git a/src/modules/evas/engines/gl_common/evas_gl_common.h b/src/modules/evas/engines/gl_common/evas_gl_common.h index 93c0b83159..1bffda531c 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_common.h +++ b/src/modules/evas/engines/gl_common/evas_gl_common.h @@ -157,6 +157,8 @@ typedef enum { SHADER_IMG_BGRA_NOMUL, SHADER_TEX, SHADER_TEX_NOMUL, + SHADER_TEX_AFILL, + SHADER_TEX_NOMUL_AFILL, SHADER_IMG_21, SHADER_IMG_21_NOMUL, @@ -164,6 +166,8 @@ typedef enum { SHADER_IMG_21_BGRA_NOMUL, SHADER_TEX_21, SHADER_TEX_21_NOMUL, + SHADER_TEX_21_AFILL, + SHADER_TEX_21_NOMUL_AFILL, SHADER_IMG_12, SHADER_IMG_12_NOMUL, @@ -171,6 +175,8 @@ typedef enum { SHADER_IMG_12_BGRA_NOMUL, SHADER_TEX_12, SHADER_TEX_12_NOMUL, + SHADER_TEX_12_AFILL, + SHADER_TEX_12_NOMUL_AFILL, SHADER_IMG_22, SHADER_IMG_22_NOMUL, @@ -178,6 +184,8 @@ typedef enum { SHADER_IMG_22_BGRA_NOMUL, SHADER_TEX_22, SHADER_TEX_22_NOMUL, + SHADER_TEX_22_AFILL, + SHADER_TEX_22_NOMUL_AFILL, SHADER_YUV, SHADER_YUV_NOMUL, 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 30571b87e5..f936bc349a 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -1574,26 +1574,42 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc, { if ((smooth) && ((sw >= (w * 2)) && (sh >= (h * 2)))) { - prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, - SHADER_TEX_22_NOMUL, SHADER_TEX_22)].prog; + if ((!tex->alpha) && (tex->pt->native)) + prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, + SHADER_TEX_22_NOMUL_AFILL, SHADER_TEX_22_AFILL)].prog; + else + prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, + SHADER_TEX_22_NOMUL, SHADER_TEX_22)].prog; sam = 1; } else if ((smooth) && (sw >= (w * 2))) { - prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, - SHADER_TEX_21_NOMUL, SHADER_TEX_21)].prog; + if ((!tex->alpha) && (tex->pt->native)) + prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, + SHADER_TEX_21_NOMUL_AFILL, SHADER_TEX_21_AFILL)].prog; + else + prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, + SHADER_TEX_21_NOMUL, SHADER_TEX_21)].prog; sam = 1; } else if ((smooth) && (sh >= (h * 2))) { - prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, - SHADER_TEX_12_NOMUL, SHADER_TEX_12)].prog; + if ((!tex->alpha) && (tex->pt->native)) + prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, + SHADER_TEX_12_NOMUL_AFILL, SHADER_TEX_12_AFILL)].prog; + else + prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, + SHADER_TEX_12_NOMUL, SHADER_TEX_12)].prog; sam = 1; } else { - prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, - SHADER_TEX_NOMUL, SHADER_TEX)].prog; + if ((!tex->alpha) && (tex->pt->native)) + prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, + SHADER_TEX_NOMUL_AFILL, SHADER_TEX_AFILL)].prog; + else + prog = gc->shared->shader[evas_gl_common_shader_choice(0, NULL, r, g, b, a, + SHADER_TEX_NOMUL, SHADER_TEX)].prog; } } } diff --git a/src/modules/evas/engines/gl_common/evas_gl_shader.c b/src/modules/evas/engines/gl_common/evas_gl_shader.c index 76402fc538..5d6bceb6d2 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_shader.c +++ b/src/modules/evas/engines/gl_common/evas_gl_shader.c @@ -158,6 +158,25 @@ Evas_GL_Program_Source shader_tex_vert_src = NULL, 0 }; +///////////////////////////////////////////// +const char tex_afill_frag_glsl[] = +#include "shader/tex_afill_frag.h" + ; +Evas_GL_Program_Source shader_tex_afill_frag_src = +{ + tex_afill_frag_glsl, + NULL, 0 +}; + +const char tex_afill_vert_glsl[] = +#include "shader/tex_afill_vert.h" + ; +Evas_GL_Program_Source shader_tex_afill_vert_src = +{ + tex_afill_vert_glsl, + NULL, 0 +}; + ///////////////////////////////////////////// const char tex_nomul_frag_glsl[] = #include "shader/tex_nomul_frag.h" @@ -177,6 +196,25 @@ Evas_GL_Program_Source shader_tex_nomul_vert_src = NULL, 0 }; +///////////////////////////////////////////// +const char tex_nomul_afill_frag_glsl[] = +#include "shader/tex_nomul_afill_frag.h" + ; +Evas_GL_Program_Source shader_tex_nomul_afill_frag_src = +{ + tex_nomul_afill_frag_glsl, + NULL, 0 +}; + +const char tex_nomul_afill_vert_glsl[] = +#include "shader/tex_nomul_afill_vert.h" + ; +Evas_GL_Program_Source shader_tex_nomul_afill_vert_src = +{ + tex_nomul_afill_vert_glsl, + NULL, 0 +}; + @@ -275,6 +313,25 @@ Evas_GL_Program_Source shader_tex_21_vert_src = NULL, 0 }; +///////////////////////////////////////////// +const char tex_21_afill_frag_glsl[] = +#include "shader/tex_21_afill_frag.h" + ; +Evas_GL_Program_Source shader_tex_21_afill_frag_src = +{ + tex_21_afill_frag_glsl, + NULL, 0 +}; + +const char tex_21_afill_vert_glsl[] = +#include "shader/tex_21_afill_vert.h" + ; +Evas_GL_Program_Source shader_tex_21_afill_vert_src = +{ + tex_21_afill_vert_glsl, + NULL, 0 +}; + ///////////////////////////////////////////// const char tex_21_nomul_frag_glsl[] = #include "shader/tex_21_nomul_frag.h" @@ -294,6 +351,25 @@ Evas_GL_Program_Source shader_tex_21_nomul_vert_src = NULL, 0 }; +///////////////////////////////////////////// +const char tex_21_nomul_afill_frag_glsl[] = +#include "shader/tex_21_nomul_afill_frag.h" + ; +Evas_GL_Program_Source shader_tex_21_nomul_afill_frag_src = +{ + tex_21_nomul_afill_frag_glsl, + NULL, 0 +}; + +const char tex_21_nomul_afill_vert_glsl[] = +#include "shader/tex_21_nomul_afill_vert.h" + ; +Evas_GL_Program_Source shader_tex_21_nomul_afill_vert_src = +{ + tex_21_nomul_afill_vert_glsl, + NULL, 0 +}; + @@ -392,6 +468,25 @@ Evas_GL_Program_Source shader_tex_12_vert_src = NULL, 0 }; +///////////////////////////////////////////// +const char tex_12_afill_frag_glsl[] = +#include "shader/tex_12_afill_frag.h" + ; +Evas_GL_Program_Source shader_tex_12_afill_frag_src = +{ + tex_12_afill_frag_glsl, + NULL, 0 +}; + +const char tex_12_afill_vert_glsl[] = +#include "shader/tex_12_afill_vert.h" + ; +Evas_GL_Program_Source shader_tex_12_afill_vert_src = +{ + tex_12_afill_vert_glsl, + NULL, 0 +}; + ///////////////////////////////////////////// const char tex_12_nomul_frag_glsl[] = #include "shader/tex_12_nomul_frag.h" @@ -411,6 +506,25 @@ Evas_GL_Program_Source shader_tex_12_nomul_vert_src = NULL, 0 }; +///////////////////////////////////////////// +const char tex_12_nomul_afill_frag_glsl[] = +#include "shader/tex_12_nomul_afill_frag.h" + ; +Evas_GL_Program_Source shader_tex_12_nomul_afill_frag_src = +{ + tex_12_nomul_afill_frag_glsl, + NULL, 0 +}; + +const char tex_12_nomul_afill_vert_glsl[] = +#include "shader/tex_12_nomul_afill_vert.h" + ; +Evas_GL_Program_Source shader_tex_12_nomul_afill_vert_src = +{ + tex_12_nomul_afill_vert_glsl, + NULL, 0 +}; + @@ -509,6 +623,25 @@ Evas_GL_Program_Source shader_tex_22_vert_src = NULL, 0 }; +///////////////////////////////////////////// +const char tex_22_afill_frag_glsl[] = +#include "shader/tex_22_afill_frag.h" + ; +Evas_GL_Program_Source shader_tex_22_afill_frag_src = +{ + tex_22_afill_frag_glsl, + NULL, 0 +}; + +const char tex_22_afill_vert_glsl[] = +#include "shader/tex_22_afill_vert.h" + ; +Evas_GL_Program_Source shader_tex_22_afill_vert_src = +{ + tex_22_afill_vert_glsl, + NULL, 0 +}; + ///////////////////////////////////////////// const char tex_22_nomul_frag_glsl[] = #include "shader/tex_22_nomul_frag.h" @@ -528,6 +661,25 @@ Evas_GL_Program_Source shader_tex_22_nomul_vert_src = NULL, 0 }; +///////////////////////////////////////////// +const char tex_22_nomul_afill_frag_glsl[] = +#include "shader/tex_22_nomul_afill_frag.h" + ; +Evas_GL_Program_Source shader_tex_22_nomul_afill_frag_src = +{ + tex_22_nomul_afill_frag_glsl, + NULL, 0 +}; + +const char tex_22_nomul_afill_vert_glsl[] = +#include "shader/tex_22_nomul_afill_vert.h" + ; +Evas_GL_Program_Source shader_tex_22_nomul_afill_vert_src = +{ + tex_22_nomul_afill_vert_glsl, + NULL, 0 +}; + @@ -887,6 +1039,8 @@ static const struct { SHADER_SOURCE_LINE(IMG_BGRA_NOMUL, img_bgra_nomul), SHADER_SOURCE_LINE(TEX, tex), SHADER_SOURCE_LINE(TEX_NOMUL, tex_nomul), + SHADER_SOURCE_LINE(TEX_AFILL, tex_afill), + SHADER_SOURCE_LINE(TEX_NOMUL_AFILL, tex_nomul_afill), SHADER_SOURCE_LINE(IMG_21, img_21), SHADER_SOURCE_LINE(IMG_21_NOMUL, img_21_nomul), @@ -894,6 +1048,8 @@ static const struct { SHADER_SOURCE_LINE(IMG_21_BGRA_NOMUL, img_21_bgra_nomul), SHADER_SOURCE_LINE(TEX_21, tex_21), SHADER_SOURCE_LINE(TEX_21_NOMUL, tex_21_nomul), + SHADER_SOURCE_LINE(TEX_21_AFILL, tex_21_afill), + SHADER_SOURCE_LINE(TEX_21_NOMUL_AFILL, tex_21_nomul_afill), SHADER_SOURCE_LINE(IMG_12, img_12), SHADER_SOURCE_LINE(IMG_12_NOMUL, img_12_nomul), @@ -901,6 +1057,8 @@ static const struct { SHADER_SOURCE_LINE(IMG_12_BGRA_NOMUL, img_12_bgra_nomul), SHADER_SOURCE_LINE(TEX_12, tex_12), SHADER_SOURCE_LINE(TEX_12_NOMUL, tex_12_nomul), + SHADER_SOURCE_LINE(TEX_12_AFILL, tex_12_afill), + SHADER_SOURCE_LINE(TEX_12_NOMUL_AFILL, tex_12_nomul_afill), SHADER_SOURCE_LINE(IMG_22, img_22), SHADER_SOURCE_LINE(IMG_22_NOMUL, img_22_nomul), @@ -908,6 +1066,8 @@ static const struct { SHADER_SOURCE_LINE(IMG_22_BGRA_NOMUL, img_22_bgra_nomul), SHADER_SOURCE_LINE(TEX_22, tex_22), SHADER_SOURCE_LINE(TEX_22_NOMUL, tex_22_nomul), + SHADER_SOURCE_LINE(TEX_22_AFILL, tex_22_afill), + SHADER_SOURCE_LINE(TEX_22_NOMUL_AFILL, tex_22_nomul_afill), SHADER_SOURCE_LINE(YUV, yuv), SHADER_SOURCE_LINE(YUV_NOMUL, yuv_nomul), diff --git a/src/modules/evas/engines/gl_common/shader/compile.sh b/src/modules/evas/engines/gl_common/shader/compile.sh index beb424d621..a039c91d6b 100755 --- a/src/modules/evas/engines/gl_common/shader/compile.sh +++ b/src/modules/evas/engines/gl_common/shader/compile.sh @@ -25,6 +25,8 @@ compile img_bgra compile img_bgra_nomul compile tex compile tex_nomul +compile tex_afill +compile tex_nomul_afill compile img_21 compile img_21_nomul @@ -32,6 +34,8 @@ compile img_21_bgra compile img_21_bgra_nomul compile tex_21 compile tex_21_nomul +compile tex_21_afill +compile tex_21_nomul_afill compile img_12 compile img_12_nomul @@ -39,6 +43,8 @@ compile img_12_bgra compile img_12_bgra_nomul compile tex_12 compile tex_12_nomul +compile tex_12_afill +compile tex_12_nomul_afill compile img_22 compile img_22_nomul @@ -46,6 +52,8 @@ compile img_22_bgra compile img_22_bgra_nomul compile tex_22 compile tex_22_nomul +compile tex_22_afill +compile tex_22_nomul_afill ## above section must have 21, 22 and 12 versions diff --git a/src/modules/evas/engines/gl_common/shader/tex_12_afill_frag.h b/src/modules/evas/engines/gl_common/shader/tex_12_afill_frag.h new file mode 100644 index 0000000000..94781bde9b --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_12_afill_frag.h @@ -0,0 +1,19 @@ +"#ifdef GL_ES\n" +"#ifdef GL_FRAGMENT_PRECISION_HIGH\n" +"precision highp float;\n" +"#else\n" +"precision mediump float;\n" +"#endif\n" +"#endif\n" +"uniform sampler2D tex;\n" +"varying vec4 col;\n" +"varying vec2 tex_c;\n" +"varying vec2 tex_s[2];\n" +"varying vec4 div_s;\n" +"void main()\n" +"{\n" +" vec4 col00 = texture2D(tex, tex_c + tex_s[0]);\n" +" vec4 col01 = texture2D(tex, tex_c + tex_s[1]);\n" +" vec4 c = (col00 + col01) / div_s;\n" +" gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_12_afill_frag.shd b/src/modules/evas/engines/gl_common/shader/tex_12_afill_frag.shd new file mode 100644 index 0000000000..ee15fdd999 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_12_afill_frag.shd @@ -0,0 +1,19 @@ +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +uniform sampler2D tex; +varying vec4 col; +varying vec2 tex_c; +varying vec2 tex_s[2]; +varying vec4 div_s; +void main() +{ + vec4 col00 = texture2D(tex, tex_c + tex_s[0]); + vec4 col01 = texture2D(tex, tex_c + tex_s[1]); + vec4 c = (col00 + col01) / div_s; + gl_FragColor = vec4(c.r, c.g, c.b, 1) * col; +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_12_afill_vert.h b/src/modules/evas/engines/gl_common/shader/tex_12_afill_vert.h new file mode 100644 index 0000000000..56cd0643aa --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_12_afill_vert.h @@ -0,0 +1,21 @@ +"#ifdef GL_ES\n" +"precision highp float;\n" +"#endif\n" +"attribute vec4 vertex;\n" +"attribute vec4 color;\n" +"attribute vec2 tex_coord;\n" +"attribute vec2 tex_sample;\n" +"uniform mat4 mvp;\n" +"varying vec4 col;\n" +"varying vec2 tex_c;\n" +"varying vec2 tex_s[2];\n" +"varying vec4 div_s;\n" +"void main()\n" +"{\n" +" gl_Position = mvp * vertex;\n" +" col = color;\n" +" tex_c = tex_coord;\n" +" tex_s[0] = vec2(0, -tex_sample.y);\n" +" tex_s[1] = vec2(0, tex_sample.y);\n" +" div_s = vec4(2, 2, 2, 2);\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_12_afill_vert.shd b/src/modules/evas/engines/gl_common/shader/tex_12_afill_vert.shd new file mode 100644 index 0000000000..810d73aaaa --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_12_afill_vert.shd @@ -0,0 +1,21 @@ +#ifdef GL_ES +precision highp float; +#endif +attribute vec4 vertex; +attribute vec4 color; +attribute vec2 tex_coord; +attribute vec2 tex_sample; +uniform mat4 mvp; +varying vec4 col; +varying vec2 tex_c; +varying vec2 tex_s[2]; +varying vec4 div_s; +void main() +{ + gl_Position = mvp * vertex; + col = color; + tex_c = tex_coord; + tex_s[0] = vec2(0, -tex_sample.y); + tex_s[1] = vec2(0, tex_sample.y); + div_s = vec4(2, 2, 2, 2); +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_frag.h b/src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_frag.h new file mode 100644 index 0000000000..3b02610ec0 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_frag.h @@ -0,0 +1,18 @@ +"#ifdef GL_ES\n" +"#ifdef GL_FRAGMENT_PRECISION_HIGH\n" +"precision highp float;\n" +"#else\n" +"precision mediump float;\n" +"#endif\n" +"#endif\n" +"uniform sampler2D tex;\n" +"varying vec2 tex_c;\n" +"varying vec2 tex_s[2];\n" +"varying vec4 div_s;\n" +"void main()\n" +"{\n" +" vec4 col00 = texture2D(tex, tex_c + tex_s[0]);\n" +" vec4 col01 = texture2D(tex, tex_c + tex_s[1]);\n" +" vec4 c = (col00 + col01) / div_s;\n" +" gl_FragColor = vec4(c.r, c.g, c.b, 1);\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_frag.shd b/src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_frag.shd new file mode 100644 index 0000000000..a7bff98683 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_frag.shd @@ -0,0 +1,18 @@ +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +uniform sampler2D tex; +varying vec2 tex_c; +varying vec2 tex_s[2]; +varying vec4 div_s; +void main() +{ + vec4 col00 = texture2D(tex, tex_c + tex_s[0]); + vec4 col01 = texture2D(tex, tex_c + tex_s[1]); + vec4 c = (col00 + col01) / div_s; + gl_FragColor = vec4(c.r, c.g, c.b, 1); +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_vert.h b/src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_vert.h new file mode 100644 index 0000000000..cee10eaf6c --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_vert.h @@ -0,0 +1,18 @@ +"#ifdef GL_ES\n" +"precision highp float;\n" +"#endif\n" +"attribute vec4 vertex;\n" +"attribute vec2 tex_coord;\n" +"attribute vec2 tex_sample;\n" +"uniform mat4 mvp;\n" +"varying vec2 tex_c;\n" +"varying vec2 tex_s[2];\n" +"varying vec4 div_s;\n" +"void main()\n" +"{\n" +" gl_Position = mvp * vertex;\n" +" tex_c = tex_coord;\n" +" tex_s[0] = vec2(0, -tex_sample.y);\n" +" tex_s[1] = vec2(0, tex_sample.y);\n" +" div_s = vec4(2, 2, 2, 2);\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_vert.shd b/src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_vert.shd new file mode 100644 index 0000000000..40144aae07 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_12_nomul_afill_vert.shd @@ -0,0 +1,18 @@ +#ifdef GL_ES +precision highp float; +#endif +attribute vec4 vertex; +attribute vec2 tex_coord; +attribute vec2 tex_sample; +uniform mat4 mvp; +varying vec2 tex_c; +varying vec2 tex_s[2]; +varying vec4 div_s; +void main() +{ + gl_Position = mvp * vertex; + tex_c = tex_coord; + tex_s[0] = vec2(0, -tex_sample.y); + tex_s[1] = vec2(0, tex_sample.y); + div_s = vec4(2, 2, 2, 2); +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_21_afill_frag.h b/src/modules/evas/engines/gl_common/shader/tex_21_afill_frag.h new file mode 100644 index 0000000000..94781bde9b --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_21_afill_frag.h @@ -0,0 +1,19 @@ +"#ifdef GL_ES\n" +"#ifdef GL_FRAGMENT_PRECISION_HIGH\n" +"precision highp float;\n" +"#else\n" +"precision mediump float;\n" +"#endif\n" +"#endif\n" +"uniform sampler2D tex;\n" +"varying vec4 col;\n" +"varying vec2 tex_c;\n" +"varying vec2 tex_s[2];\n" +"varying vec4 div_s;\n" +"void main()\n" +"{\n" +" vec4 col00 = texture2D(tex, tex_c + tex_s[0]);\n" +" vec4 col01 = texture2D(tex, tex_c + tex_s[1]);\n" +" vec4 c = (col00 + col01) / div_s;\n" +" gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_21_afill_frag.shd b/src/modules/evas/engines/gl_common/shader/tex_21_afill_frag.shd new file mode 100644 index 0000000000..ee15fdd999 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_21_afill_frag.shd @@ -0,0 +1,19 @@ +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +uniform sampler2D tex; +varying vec4 col; +varying vec2 tex_c; +varying vec2 tex_s[2]; +varying vec4 div_s; +void main() +{ + vec4 col00 = texture2D(tex, tex_c + tex_s[0]); + vec4 col01 = texture2D(tex, tex_c + tex_s[1]); + vec4 c = (col00 + col01) / div_s; + gl_FragColor = vec4(c.r, c.g, c.b, 1) * col; +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_21_afill_vert.h b/src/modules/evas/engines/gl_common/shader/tex_21_afill_vert.h new file mode 100644 index 0000000000..88d1470f26 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_21_afill_vert.h @@ -0,0 +1,21 @@ +"#ifdef GL_ES\n" +"precision highp float;\n" +"#endif\n" +"attribute vec4 vertex;\n" +"attribute vec4 color;\n" +"attribute vec2 tex_coord;\n" +"attribute vec2 tex_sample;\n" +"uniform mat4 mvp;\n" +"varying vec4 col;\n" +"varying vec2 tex_c;\n" +"varying vec2 tex_s[2];\n" +"varying vec4 div_s;\n" +"void main()\n" +"{\n" +" gl_Position = mvp * vertex;\n" +" col = color;\n" +" tex_c = tex_coord;\n" +" tex_s[0] = vec2(-tex_sample.x, 0);\n" +" tex_s[1] = vec2( tex_sample.x, 0);\n" +" div_s = vec4(2, 2, 2, 2);\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_21_afill_vert.shd b/src/modules/evas/engines/gl_common/shader/tex_21_afill_vert.shd new file mode 100644 index 0000000000..98d9154a73 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_21_afill_vert.shd @@ -0,0 +1,21 @@ +#ifdef GL_ES +precision highp float; +#endif +attribute vec4 vertex; +attribute vec4 color; +attribute vec2 tex_coord; +attribute vec2 tex_sample; +uniform mat4 mvp; +varying vec4 col; +varying vec2 tex_c; +varying vec2 tex_s[2]; +varying vec4 div_s; +void main() +{ + gl_Position = mvp * vertex; + col = color; + tex_c = tex_coord; + tex_s[0] = vec2(-tex_sample.x, 0); + tex_s[1] = vec2( tex_sample.x, 0); + div_s = vec4(2, 2, 2, 2); +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_frag.h b/src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_frag.h new file mode 100644 index 0000000000..3b02610ec0 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_frag.h @@ -0,0 +1,18 @@ +"#ifdef GL_ES\n" +"#ifdef GL_FRAGMENT_PRECISION_HIGH\n" +"precision highp float;\n" +"#else\n" +"precision mediump float;\n" +"#endif\n" +"#endif\n" +"uniform sampler2D tex;\n" +"varying vec2 tex_c;\n" +"varying vec2 tex_s[2];\n" +"varying vec4 div_s;\n" +"void main()\n" +"{\n" +" vec4 col00 = texture2D(tex, tex_c + tex_s[0]);\n" +" vec4 col01 = texture2D(tex, tex_c + tex_s[1]);\n" +" vec4 c = (col00 + col01) / div_s;\n" +" gl_FragColor = vec4(c.r, c.g, c.b, 1);\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_frag.shd b/src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_frag.shd new file mode 100644 index 0000000000..a7bff98683 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_frag.shd @@ -0,0 +1,18 @@ +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +uniform sampler2D tex; +varying vec2 tex_c; +varying vec2 tex_s[2]; +varying vec4 div_s; +void main() +{ + vec4 col00 = texture2D(tex, tex_c + tex_s[0]); + vec4 col01 = texture2D(tex, tex_c + tex_s[1]); + vec4 c = (col00 + col01) / div_s; + gl_FragColor = vec4(c.r, c.g, c.b, 1); +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_vert.h b/src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_vert.h new file mode 100644 index 0000000000..7c7d7db63b --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_vert.h @@ -0,0 +1,18 @@ +"#ifdef GL_ES\n" +"precision highp float;\n" +"#endif\n" +"attribute vec4 vertex;\n" +"attribute vec2 tex_coord;\n" +"attribute vec2 tex_sample;\n" +"uniform mat4 mvp;\n" +"varying vec2 tex_c;\n" +"varying vec2 tex_s[2];\n" +"varying vec4 div_s;\n" +"void main()\n" +"{\n" +" gl_Position = mvp * vertex;\n" +" tex_c = tex_coord;\n" +" tex_s[0] = vec2(-tex_sample.x, 0);\n" +" tex_s[1] = vec2( tex_sample.x, 0);\n" +" div_s = vec4(2, 2, 2, 2);\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_vert.shd b/src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_vert.shd new file mode 100644 index 0000000000..a6b149f5c5 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_21_nomul_afill_vert.shd @@ -0,0 +1,18 @@ +#ifdef GL_ES +precision highp float; +#endif +attribute vec4 vertex; +attribute vec2 tex_coord; +attribute vec2 tex_sample; +uniform mat4 mvp; +varying vec2 tex_c; +varying vec2 tex_s[2]; +varying vec4 div_s; +void main() +{ + gl_Position = mvp * vertex; + tex_c = tex_coord; + tex_s[0] = vec2(-tex_sample.x, 0); + tex_s[1] = vec2( tex_sample.x, 0); + div_s = vec4(2, 2, 2, 2); +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_22_afill_frag.h b/src/modules/evas/engines/gl_common/shader/tex_22_afill_frag.h new file mode 100644 index 0000000000..5d2be195ad --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_22_afill_frag.h @@ -0,0 +1,21 @@ +"#ifdef GL_ES\n" +"#ifdef GL_FRAGMENT_PRECISION_HIGH\n" +"precision highp float;\n" +"#else\n" +"precision mediump float;\n" +"#endif\n" +"#endif\n" +"uniform sampler2D tex;\n" +"varying vec4 col;\n" +"varying vec2 tex_c;\n" +"varying vec2 tex_s[4];\n" +"varying vec4 div_s;\n" +"void main()\n" +"{\n" +" vec4 col00 = texture2D(tex, tex_c + tex_s[0]);\n" +" vec4 col01 = texture2D(tex, tex_c + tex_s[1]);\n" +" vec4 col10 = texture2D(tex, tex_c + tex_s[2]);\n" +" vec4 col11 = texture2D(tex, tex_c + tex_s[3]);\n" +" vec4 c = (col00 + col01 + col10 + col11) / div_s;\n" +" gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_22_afill_frag.shd b/src/modules/evas/engines/gl_common/shader/tex_22_afill_frag.shd new file mode 100644 index 0000000000..cb2dd2b488 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_22_afill_frag.shd @@ -0,0 +1,21 @@ +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +uniform sampler2D tex; +varying vec4 col; +varying vec2 tex_c; +varying vec2 tex_s[4]; +varying vec4 div_s; +void main() +{ + vec4 col00 = texture2D(tex, tex_c + tex_s[0]); + vec4 col01 = texture2D(tex, tex_c + tex_s[1]); + vec4 col10 = texture2D(tex, tex_c + tex_s[2]); + vec4 col11 = texture2D(tex, tex_c + tex_s[3]); + vec4 c = (col00 + col01 + col10 + col11) / div_s; + gl_FragColor = vec4(c.r, c.g, c.b, 1) * col; +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_22_afill_vert.h b/src/modules/evas/engines/gl_common/shader/tex_22_afill_vert.h new file mode 100644 index 0000000000..e1fc7f4558 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_22_afill_vert.h @@ -0,0 +1,23 @@ +"#ifdef GL_ES\n" +"precision highp float;\n" +"#endif\n" +"attribute vec4 vertex;\n" +"attribute vec4 color;\n" +"attribute vec2 tex_coord;\n" +"attribute vec2 tex_sample;\n" +"uniform mat4 mvp;\n" +"varying vec4 col;\n" +"varying vec2 tex_c;\n" +"varying vec2 tex_s[4];\n" +"varying vec4 div_s;\n" +"void main()\n" +"{\n" +" gl_Position = mvp * vertex;\n" +" col = color;\n" +" tex_c = tex_coord;\n" +" tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" +" tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" +" tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" +" tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" +" div_s = vec4(4, 4, 4, 4);\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_22_afill_vert.shd b/src/modules/evas/engines/gl_common/shader/tex_22_afill_vert.shd new file mode 100644 index 0000000000..e964ea1e81 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_22_afill_vert.shd @@ -0,0 +1,23 @@ +#ifdef GL_ES +precision highp float; +#endif +attribute vec4 vertex; +attribute vec4 color; +attribute vec2 tex_coord; +attribute vec2 tex_sample; +uniform mat4 mvp; +varying vec4 col; +varying vec2 tex_c; +varying vec2 tex_s[4]; +varying vec4 div_s; +void main() +{ + gl_Position = mvp * vertex; + col = color; + tex_c = tex_coord; + tex_s[0] = vec2(-tex_sample.x, -tex_sample.y); + tex_s[1] = vec2( tex_sample.x, -tex_sample.y); + tex_s[2] = vec2( tex_sample.x, tex_sample.y); + tex_s[3] = vec2(-tex_sample.x, tex_sample.y); + div_s = vec4(4, 4, 4, 4); +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_frag.h b/src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_frag.h new file mode 100644 index 0000000000..ce33563868 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_frag.h @@ -0,0 +1,20 @@ +"#ifdef GL_ES\n" +"#ifdef GL_FRAGMENT_PRECISION_HIGH\n" +"precision highp float;\n" +"#else\n" +"precision mediump float;\n" +"#endif\n" +"#endif\n" +"uniform sampler2D tex;\n" +"varying vec2 tex_c;\n" +"varying vec2 tex_s[4];\n" +"varying vec4 div_s;\n" +"void main()\n" +"{\n" +" vec4 col00 = texture2D(tex, tex_c + tex_s[0]);\n" +" vec4 col01 = texture2D(tex, tex_c + tex_s[1]);\n" +" vec4 col10 = texture2D(tex, tex_c + tex_s[2]);\n" +" vec4 col11 = texture2D(tex, tex_c + tex_s[3]);\n" +" vec4 c = (col00 + col01 + col10 + col11) / div_s;\n" +" gl_FragColor = vec4(c.r, c.g, c.b, 1);\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_frag.shd b/src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_frag.shd new file mode 100644 index 0000000000..c017c31770 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_frag.shd @@ -0,0 +1,20 @@ +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +uniform sampler2D tex; +varying vec2 tex_c; +varying vec2 tex_s[4]; +varying vec4 div_s; +void main() +{ + vec4 col00 = texture2D(tex, tex_c + tex_s[0]); + vec4 col01 = texture2D(tex, tex_c + tex_s[1]); + vec4 col10 = texture2D(tex, tex_c + tex_s[2]); + vec4 col11 = texture2D(tex, tex_c + tex_s[3]); + vec4 c = (col00 + col01 + col10 + col11) / div_s; + gl_FragColor = vec4(c.r, c.g, c.b, 1); +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_vert.h b/src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_vert.h new file mode 100644 index 0000000000..c6fb270bf7 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_vert.h @@ -0,0 +1,20 @@ +"#ifdef GL_ES\n" +"precision highp float;\n" +"#endif\n" +"attribute vec4 vertex;\n" +"attribute vec2 tex_coord;\n" +"attribute vec2 tex_sample;\n" +"uniform mat4 mvp;\n" +"varying vec2 tex_c;\n" +"varying vec2 tex_s[4];\n" +"varying vec4 div_s;\n" +"void main()\n" +"{\n" +" gl_Position = mvp * vertex;\n" +" tex_c = tex_coord;\n" +" tex_s[0] = vec2(-tex_sample.x, -tex_sample.y);\n" +" tex_s[1] = vec2( tex_sample.x, -tex_sample.y);\n" +" tex_s[2] = vec2( tex_sample.x, tex_sample.y);\n" +" tex_s[3] = vec2(-tex_sample.x, tex_sample.y);\n" +" div_s = vec4(4, 4, 4, 4);\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_vert.shd b/src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_vert.shd new file mode 100644 index 0000000000..e6303d782d --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_22_nomul_afill_vert.shd @@ -0,0 +1,20 @@ +#ifdef GL_ES +precision highp float; +#endif +attribute vec4 vertex; +attribute vec2 tex_coord; +attribute vec2 tex_sample; +uniform mat4 mvp; +varying vec2 tex_c; +varying vec2 tex_s[4]; +varying vec4 div_s; +void main() +{ + gl_Position = mvp * vertex; + tex_c = tex_coord; + tex_s[0] = vec2(-tex_sample.x, -tex_sample.y); + tex_s[1] = vec2( tex_sample.x, -tex_sample.y); + tex_s[2] = vec2( tex_sample.x, tex_sample.y); + tex_s[3] = vec2(-tex_sample.x, tex_sample.y); + div_s = vec4(4, 4, 4, 4); +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_afill_frag.h b/src/modules/evas/engines/gl_common/shader/tex_afill_frag.h new file mode 100644 index 0000000000..601685328c --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_afill_frag.h @@ -0,0 +1,15 @@ +"#ifdef GL_ES\n" +"#ifdef GL_FRAGMENT_PRECISION_HIGH\n" +"precision highp float;\n" +"#else\n" +"precision mediump float;\n" +"#endif\n" +"#endif\n" +"uniform sampler2D tex;\n" +"varying vec4 col;\n" +"varying vec2 tex_c;\n" +"void main()\n" +"{\n" +" vec4 c = texture2D(tex, tex_c.xy);\n" +" gl_FragColor = vec4(c.r, c.g, c.b, 1) * col;\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_afill_frag.shd b/src/modules/evas/engines/gl_common/shader/tex_afill_frag.shd new file mode 100644 index 0000000000..9ee0c37710 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_afill_frag.shd @@ -0,0 +1,15 @@ +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +uniform sampler2D tex; +varying vec4 col; +varying vec2 tex_c; +void main() +{ + vec4 c = texture2D(tex, tex_c.xy); + gl_FragColor = vec4(c.r, c.g, c.b, 1) * col; +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_afill_vert.h b/src/modules/evas/engines/gl_common/shader/tex_afill_vert.h new file mode 100644 index 0000000000..8921d9dfeb --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_afill_vert.h @@ -0,0 +1,15 @@ +"#ifdef GL_ES\n" +"precision highp float;\n" +"#endif\n" +"attribute vec4 vertex;\n" +"attribute vec4 color;\n" +"attribute vec2 tex_coord;\n" +"uniform mat4 mvp;\n" +"varying vec4 col;\n" +"varying vec2 tex_c;\n" +"void main()\n" +"{\n" +" gl_Position = mvp * vertex;\n" +" col = color;\n" +" tex_c = tex_coord;\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_afill_vert.shd b/src/modules/evas/engines/gl_common/shader/tex_afill_vert.shd new file mode 100644 index 0000000000..606c297e6d --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_afill_vert.shd @@ -0,0 +1,15 @@ +#ifdef GL_ES +precision highp float; +#endif +attribute vec4 vertex; +attribute vec4 color; +attribute vec2 tex_coord; +uniform mat4 mvp; +varying vec4 col; +varying vec2 tex_c; +void main() +{ + gl_Position = mvp * vertex; + col = color; + tex_c = tex_coord; +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_nomul_afill_frag.h b/src/modules/evas/engines/gl_common/shader/tex_nomul_afill_frag.h new file mode 100644 index 0000000000..43f7e63390 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_nomul_afill_frag.h @@ -0,0 +1,14 @@ +"#ifdef GL_ES\n" +"#ifdef GL_FRAGMENT_PRECISION_HIGH\n" +"precision highp float;\n" +"#else\n" +"precision mediump float;\n" +"#endif\n" +"#endif\n" +"uniform sampler2D tex;\n" +"varying vec2 tex_c;\n" +"void main()\n" +"{\n" +" vec4 c = texture2D(tex, tex_c.xy);\n" +" gl_FragColor = vec4(c.r, c.g, c.b, 1);\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_nomul_afill_frag.shd b/src/modules/evas/engines/gl_common/shader/tex_nomul_afill_frag.shd new file mode 100644 index 0000000000..569c32e56a --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_nomul_afill_frag.shd @@ -0,0 +1,14 @@ +#ifdef GL_ES +#ifdef GL_FRAGMENT_PRECISION_HIGH +precision highp float; +#else +precision mediump float; +#endif +#endif +uniform sampler2D tex; +varying vec2 tex_c; +void main() +{ + vec4 c = texture2D(tex, tex_c.xy); + gl_FragColor = vec4(c.r, c.g, c.b, 1); +} diff --git a/src/modules/evas/engines/gl_common/shader/tex_nomul_afill_vert.h b/src/modules/evas/engines/gl_common/shader/tex_nomul_afill_vert.h new file mode 100644 index 0000000000..13d5edd21a --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_nomul_afill_vert.h @@ -0,0 +1,12 @@ +"#ifdef GL_ES\n" +"precision highp float;\n" +"#endif\n" +"attribute vec4 vertex;\n" +"attribute vec2 tex_coord;\n" +"uniform mat4 mvp;\n" +"varying vec2 tex_c;\n" +"void main()\n" +"{\n" +" gl_Position = mvp * vertex;\n" +" tex_c = tex_coord;\n" +"}\n" diff --git a/src/modules/evas/engines/gl_common/shader/tex_nomul_afill_vert.shd b/src/modules/evas/engines/gl_common/shader/tex_nomul_afill_vert.shd new file mode 100644 index 0000000000..74f3207177 --- /dev/null +++ b/src/modules/evas/engines/gl_common/shader/tex_nomul_afill_vert.shd @@ -0,0 +1,12 @@ +#ifdef GL_ES +precision highp float; +#endif +attribute vec4 vertex; +attribute vec2 tex_coord; +uniform mat4 mvp; +varying vec2 tex_c; +void main() +{ + gl_Position = mvp * vertex; + tex_c = tex_coord; +}