evas/gl - removed redundant shader masking code.
authorChunEon Park <hermet@hermet.pe.kr>
Fri, 4 Jul 2014 12:10:20 +0000 (21:10 +0900)
committerChunEon Park <hermet@hermet.pe.kr>
Fri, 4 Jul 2014 12:10:20 +0000 (21:10 +0900)
src/modules/evas/engines/gl_common/evas_gl_context.c
src/modules/evas/engines/gl_common/evas_gl_shader.c
src/modules/evas/engines/gl_common/shader/compile.sh
src/modules/evas/engines/gl_common/shader/img_mask_frag.h [deleted file]
src/modules/evas/engines/gl_common/shader/img_mask_frag.shd [deleted file]
src/modules/evas/engines/gl_common/shader/img_mask_vert.h [deleted file]
src/modules/evas/engines/gl_common/shader/img_mask_vert.shd [deleted file]

index e24d2ba..d3204c3 100644 (file)
@@ -1914,134 +1914,6 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
 }
 
 void
-evas_gl_common_context_image_mask_push(Evas_Engine_GL_Context *gc,
-                                  Evas_GL_Texture *tex,
-                                  Evas_GL_Texture *texm,
-                                  double sx, double sy, double sw, double sh,
-                                  double sxm, double sym, double swm,double shm,
-                                  int x, int y, int w, int h,
-                                  int r, int g, int b, int a,
-                                  Eina_Bool smooth)
-{
-   int pnum, nv, nc, nu, nm, i;
-   GLfloat tx1, tx2, ty1, ty2;
-   GLfloat txm1, txm2, tym1, tym2;
-   Eina_Bool blend = 1;
-   GLuint prog = gc->shared->shader[SHADER_IMG_MASK].prog;
-   int pn = 0;
-
-#if 0
-   if (tex->gc->shared->info.bgra)
-   {
-      prog = gc->shared->shader[SHADER_IMG_MASK].prog;
-   }
-   else
-   {
-#warning Nash: FIXME: Need two shaders?
-          printf("Not good: Need other texture\n");
-          prog = gc->shared->shader[SHADER_IMG].prog;
-   }
-#endif
-
-   pn = _evas_gl_common_context_push(RTYPE_IMASK,
-                                     gc, tex, texm,
-                                     prog,
-                                     x, y, w, h,
-                                     blend,
-                                     smooth,
-                                     0, 0, 0, 0, 0);
-
-   gc->pipe[pn].region.type = RTYPE_IMASK;
-   gc->pipe[pn].shader.cur_tex = tex->pt->texture;
-   gc->pipe[pn].shader.cur_texm = texm->pt->texture;
-   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.clip = 0;
-   gc->pipe[pn].shader.cx = 0;
-   gc->pipe[pn].shader.cy = 0;
-   gc->pipe[pn].shader.cw = 0;
-   gc->pipe[pn].shader.ch = 0;
-   gc->pipe[pn].array.line = 0;
-   gc->pipe[pn].array.use_vertex = 1;
-   // if nomul... dont need this
-   gc->pipe[pn].array.use_color = 1;
-   gc->pipe[pn].array.use_texuv = 1;
-   gc->pipe[pn].array.use_texuv2 = 0;
-   gc->pipe[pn].array.use_texuv3 = 0;
-   gc->pipe[pn].array.use_texm = 1;
-   gc->pipe[pn].array.use_texsam = 0;
-
-   pipe_region_expand(gc, pn, x, y, w, h);
-
-   pnum = gc->pipe[pn].array.num;
-   nv = pnum * 3; nc = pnum * 4; nm = pnum * 2; nu = pnum * 2;
-   gc->pipe[pn].array.num += 6;
-   array_alloc(gc, pn);
-
-   if ((tex->im) && (tex->im->native.data) && (!tex->im->native.yinvert))
-     {
-        tx1 = ((double)(tex->x) + sx) / (double)tex->pt->w;
-        ty1 = ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
-        tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w;
-        ty2 = ((double)(tex->y) + sy) / (double)tex->pt->h;
-
-        txm1 = ((double)(texm->x) + sxm) / (double)texm->pt->w;
-        tym1 = ((double)(texm->y) + sym + shm) / (double)texm->pt->h;
-        txm2 = ((double)(texm->x) + sxm + swm) / (double)texm->pt->w;
-        tym2 = ((double)(texm->y) + sym) / (double)texm->pt->h;
-     }
-   else
-     {
-        tx1 = ((double)(tex->x) + sx) / (double)tex->pt->w;
-        ty1 = ((double)(tex->y) + sy) / (double)tex->pt->h;
-        tx2 = ((double)(tex->x) + sx + sw) / (double)tex->pt->w;
-        ty2 = ((double)(tex->y) + sy + sh) / (double)tex->pt->h;
-
-        txm1 = (texm->x + sxm) / (double)texm->pt->w;
-        tym1 = (texm->y + sym) / (double)texm->pt->h;
-        txm2 = (texm->x + sxm + swm) / (double)texm->pt->w;
-        tym2 = (texm->y + sym + shm) / (double)texm->pt->h;
-     }
- // printf(" %3.6lf %3.6lf %3.6lf %3.6lf\n",sx,sy,sw,sh);
- //  printf("m%3.6lf %3.6lf %3.6lf %3.6lf\n",sxm,sym,swm,shm);
- // printf(" %3f %3f %3f %3f\n",tx1,ty1,tx2,ty2);
- // printf("m%3f %3f %3f %3f\n",txm1,tym1,txm2,tym2);
-
-   PUSH_VERTEX(pn, x    , y    , 0);
-   PUSH_VERTEX(pn, x + w, y    , 0);
-   PUSH_VERTEX(pn, x    , y + h, 0);
-
-   PUSH_TEXUV(pn, tx1, ty1);
-   PUSH_TEXUV(pn, tx2, ty1);
-   PUSH_TEXUV(pn, tx1, ty2);
-
-   PUSH_TEXM(pn, txm1, tym1);
-   PUSH_TEXM(pn, txm2, tym1);
-   PUSH_TEXM(pn, txm1, tym2);
-
-   PUSH_VERTEX(pn, x + w, y    , 0);
-   PUSH_VERTEX(pn, x + w, y + h, 0);
-   PUSH_VERTEX(pn, x    , y + h, 0);
-
-   PUSH_TEXUV(pn, tx2, ty1);
-   PUSH_TEXUV(pn, tx2, ty2);
-   PUSH_TEXUV(pn, tx1, ty2);
-
-   PUSH_TEXM(pn, txm2, tym1);
-   PUSH_TEXM(pn, txm2, tym2);
-   PUSH_TEXM(pn, txm1, tym2);
-
-   // if nomul... dont need this
-   for (i = 0; i < 6; i++)
-     {
-        PUSH_COLOR(pn, r, g, b, a);
-     }
-}
-
-
-void
 evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc,
                                  Evas_GL_Texture *tex,
                                  double sx, double sy, double sw, double sh,
index 5d6bceb..ef37278 100644 (file)
@@ -38,31 +38,6 @@ Evas_GL_Program_Source shader_font_vert_src =
    NULL, 0
 };
 
-
-
-
-/////////////////////////////////////////////
-const char img_mask_frag_glsl[] =
-#include "shader/img_mask_frag.h"
-  ;
-Evas_GL_Program_Source shader_img_mask_frag_src =
-{
-   img_mask_frag_glsl,
-   NULL, 0
-};
-
-const char img_mask_vert_glsl[] =
-#include "shader/img_mask_vert.h"
-  ;
-Evas_GL_Program_Source shader_img_mask_vert_src =
-{
-   img_mask_vert_glsl,
-   NULL, 0
-};
-
-
-
-
 /////////////////////////////////////////////
 const char img_frag_glsl[] =
 #include "shader/img_frag.h"
@@ -1031,8 +1006,6 @@ static const struct {
   SHADER_SOURCE_LINE(RECT, rect),
   SHADER_SOURCE_LINE(FONT, font),
    
-  SHADER_SOURCE_LINE(IMG_MASK, img_mask),
-   
   SHADER_SOURCE_LINE(IMG, img),
   SHADER_SOURCE_LINE(IMG_NOMUL, img_nomul),
   SHADER_SOURCE_LINE(IMG_BGRA, img_bgra),
index a039c91..fade478 100755 (executable)
@@ -17,8 +17,6 @@ function compile()
 compile rect
 compile font
 
-compile img_mask
-
 compile img
 compile img_nomul
 compile img_bgra
diff --git a/src/modules/evas/engines/gl_common/shader/img_mask_frag.h b/src/modules/evas/engines/gl_common/shader/img_mask_frag.h
deleted file mode 100644 (file)
index 1b28128..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-"#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, texm;\n"
-"varying vec4 col;\n"
-"varying vec2 tex_c, tex_cm;\n"
-"void main()\n"
-"{\n"
-"   gl_FragColor = texture2D(texm, tex_cm.xy).aaaa * texture2D(tex, tex_c.xy).rgba * col;\n"
-"}\n"
-"\n"
diff --git a/src/modules/evas/engines/gl_common/shader/img_mask_frag.shd b/src/modules/evas/engines/gl_common/shader/img_mask_frag.shd
deleted file mode 100644 (file)
index 0b7307e..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#ifdef GL_ES
-#ifdef GL_FRAGMENT_PRECISION_HIGH
-precision highp float;
-#else
-precision mediump float;
-#endif
-#endif
-uniform sampler2D tex, texm;
-varying vec4 col;
-varying vec2 tex_c, tex_cm;
-void main()
-{
-   gl_FragColor = texture2D(texm, tex_cm.xy).aaaa * texture2D(tex, tex_c.xy).rgba * col;
-}
-
diff --git a/src/modules/evas/engines/gl_common/shader/img_mask_vert.h b/src/modules/evas/engines/gl_common/shader/img_mask_vert.h
deleted file mode 100644 (file)
index 7508c98..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-"#ifdef GL_ES\n"
-"precision highp float;\n"
-"#endif\n"
-"attribute vec4 vertex;\n"
-"attribute vec4 color;\n"
-"attribute vec2 tex_coord, tex_coordm;\n"
-"uniform mat4 mvp;\n"
-"varying vec4 col;\n"
-"varying vec2 tex_c, tex_cm;\n"
-"void main()\n"
-"{\n"
-"   gl_Position = mvp * vertex;\n"
-"   col = color;\n"
-"   tex_c = tex_coord;\n"
-"   tex_cm = tex_coordm;\n"
-"}\n"
diff --git a/src/modules/evas/engines/gl_common/shader/img_mask_vert.shd b/src/modules/evas/engines/gl_common/shader/img_mask_vert.shd
deleted file mode 100644 (file)
index 1414870..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifdef GL_ES
-precision highp float;
-#endif
-attribute vec4 vertex;
-attribute vec4 color;
-attribute vec2 tex_coord, tex_coordm;
-uniform mat4 mvp;
-varying vec4 col;
-varying vec2 tex_c, tex_cm;
-void main()
-{
-   gl_Position = mvp * vertex;
-   col = color;
-   tex_c = tex_coord;
-   tex_cm = tex_coordm;
-}