summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2014-12-02 15:19:10 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-12-22 22:33:11 +0900
commit6f7ecd15cb98362fdb60310118fc1187422a7f5a (patch)
tree6851f0aa04d878ea5b57f2cb60f41744dc983c77 /src/modules
parentcaa742b84e114779b6f68078df3b7c8eaee85728 (diff)
Evas masking: Add rectangle masking for GL
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_common.h3
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_context.c31
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_polygon.c10
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_rectangle.c18
-rw-r--r--src/modules/evas/engines/gl_common/shader/evas_gl_enum.x1
-rw-r--r--src/modules/evas/engines/gl_common/shader/evas_gl_shaders.x46
-rw-r--r--src/modules/evas/engines/gl_common/shader/rect_mask_frag.shd14
-rw-r--r--src/modules/evas/engines/gl_common/shader/rect_mask_vert.shd15
8 files changed, 128 insertions, 10 deletions
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 37873d24fe..421bd14918 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -720,7 +720,8 @@ void evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc,
720 int r, int g, int b, int a); 720 int r, int g, int b, int a);
721void evas_gl_common_context_rectangle_push(Evas_Engine_GL_Context *gc, 721void evas_gl_common_context_rectangle_push(Evas_Engine_GL_Context *gc,
722 int x, int y, int w, int h, 722 int x, int y, int w, int h,
723 int r, int g, int b, int a); 723 int r, int g, int b, int a,
724 Evas_GL_Texture *mtex, int mx, int my, int mw, int mh);
724void evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc, 725void evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
725 Evas_GL_Texture *tex, 726 Evas_GL_Texture *tex,
726 double sx, double sy, double sw, double sh, 727 double sx, double sy, double sw, double sh,
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 ae5f11469e..2adc874e2f 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -883,6 +883,8 @@ evas_gl_common_context_new(void)
883 SHADER_TEXTURE_ADD(shared, FONT_MASK, tex); 883 SHADER_TEXTURE_ADD(shared, FONT_MASK, tex);
884 SHADER_TEXTURE_ADD(shared, FONT_MASK, texm); 884 SHADER_TEXTURE_ADD(shared, FONT_MASK, texm);
885 885
886 SHADER_TEXTURE_ADD(shared, RECT_MASK, texm);
887
886 if (gc->state.current.cur_prog == PRG_INVALID) 888 if (gc->state.current.cur_prog == PRG_INVALID)
887 glUseProgram(shared->shader[0].prog); 889 glUseProgram(shared->shader[0].prog);
888 else glUseProgram(gc->state.current.cur_prog); 890 else glUseProgram(gc->state.current.cur_prog);
@@ -1569,15 +1571,25 @@ evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc,
1569void 1571void
1570evas_gl_common_context_rectangle_push(Evas_Engine_GL_Context *gc, 1572evas_gl_common_context_rectangle_push(Evas_Engine_GL_Context *gc,
1571 int x, int y, int w, int h, 1573 int x, int y, int w, int h,
1572 int r, int g, int b, int a) 1574 int r, int g, int b, int a,
1575 Evas_GL_Texture *mtex,
1576 int mx, int my, int mw, int mh)
1573{ 1577{
1574 Eina_Bool blend = EINA_FALSE; 1578 Eina_Bool blend = EINA_FALSE;
1575 GLuint prog = gc->shared->shader[SHADER_RECT].prog; 1579 GLuint prog = gc->shared->shader[SHADER_RECT].prog;
1580 GLuint mtexid = 0;
1576 int pn = 0; 1581 int pn = 0;
1577 1582
1578 if (!(gc->dc->render_op == EVAS_RENDER_COPY) && (a < 255)) 1583 if (!(gc->dc->render_op == EVAS_RENDER_COPY) && (a < 255))
1579 blend = EINA_TRUE; 1584 blend = EINA_TRUE;
1580 1585
1586 if (mtex)
1587 {
1588 blend = EINA_TRUE;
1589 mtexid = mtex->pt->texture;
1590 prog = gc->shared->shader[SHADER_RECT_MASK].prog;
1591 }
1592
1581again: 1593again:
1582 vertex_array_size_check(gc, gc->state.top_pipe, 6); 1594 vertex_array_size_check(gc, gc->state.top_pipe, 6);
1583 pn = gc->state.top_pipe; 1595 pn = gc->state.top_pipe;
@@ -1586,6 +1598,7 @@ again:
1586 { 1598 {
1587 gc->pipe[pn].region.type = RTYPE_RECT; 1599 gc->pipe[pn].region.type = RTYPE_RECT;
1588 gc->pipe[pn].shader.cur_tex = 0; 1600 gc->pipe[pn].shader.cur_tex = 0;
1601 gc->pipe[pn].shader.cur_texm = mtexid;
1589 gc->pipe[pn].shader.cur_prog = prog; 1602 gc->pipe[pn].shader.cur_prog = prog;
1590 gc->pipe[pn].shader.blend = blend; 1603 gc->pipe[pn].shader.blend = blend;
1591 gc->pipe[pn].shader.render_op = gc->dc->render_op; 1604 gc->pipe[pn].shader.render_op = gc->dc->render_op;
@@ -1602,7 +1615,7 @@ again:
1602 gc->pipe[pn].array.use_texuv3 = 0; 1615 gc->pipe[pn].array.use_texuv3 = 0;
1603 gc->pipe[pn].array.use_texa = 0; 1616 gc->pipe[pn].array.use_texa = 0;
1604 gc->pipe[pn].array.use_texsam = 0; 1617 gc->pipe[pn].array.use_texsam = 0;
1605 gc->pipe[pn].array.use_texm = 0; 1618 gc->pipe[pn].array.use_texm = !!mtex;
1606 } 1619 }
1607 else 1620 else
1608 { 1621 {
@@ -1612,6 +1625,7 @@ again:
1612 { 1625 {
1613 if ((gc->pipe[i].region.type == RTYPE_RECT) 1626 if ((gc->pipe[i].region.type == RTYPE_RECT)
1614 && (gc->pipe[i].shader.cur_tex == 0) 1627 && (gc->pipe[i].shader.cur_tex == 0)
1628 && (gc->pipe[i].shader.cur_texm == mtexid)
1615 && (gc->pipe[i].shader.cur_prog == prog) 1629 && (gc->pipe[i].shader.cur_prog == prog)
1616 && (gc->pipe[i].shader.blend == blend) 1630 && (gc->pipe[i].shader.blend == blend)
1617 && (gc->pipe[i].shader.render_op == gc->dc->render_op) 1631 && (gc->pipe[i].shader.render_op == gc->dc->render_op)
@@ -1635,6 +1649,7 @@ again:
1635 gc->state.top_pipe = pn; 1649 gc->state.top_pipe = pn;
1636 gc->pipe[pn].region.type = RTYPE_RECT; 1650 gc->pipe[pn].region.type = RTYPE_RECT;
1637 gc->pipe[pn].shader.cur_tex = 0; 1651 gc->pipe[pn].shader.cur_tex = 0;
1652 gc->pipe[pn].shader.cur_texm = mtexid;
1638 gc->pipe[pn].shader.cur_prog = prog; 1653 gc->pipe[pn].shader.cur_prog = prog;
1639 gc->pipe[pn].shader.blend = blend; 1654 gc->pipe[pn].shader.blend = blend;
1640 gc->pipe[pn].shader.render_op = gc->dc->render_op; 1655 gc->pipe[pn].shader.render_op = gc->dc->render_op;
@@ -1651,11 +1666,12 @@ again:
1651 gc->pipe[pn].array.use_texuv3 = 0; 1666 gc->pipe[pn].array.use_texuv3 = 0;
1652 gc->pipe[pn].array.use_texa = 0; 1667 gc->pipe[pn].array.use_texa = 0;
1653 gc->pipe[pn].array.use_texsam = 0; 1668 gc->pipe[pn].array.use_texsam = 0;
1654 gc->pipe[pn].array.use_texm = 0; 1669 gc->pipe[pn].array.use_texm = !!mtex;
1655 } 1670 }
1656 } 1671 }
1657#else 1672#else
1658 if ((gc->pipe[pn].shader.cur_tex != 0) 1673 if ((gc->pipe[pn].shader.cur_tex != 0)
1674 || (gc->pipe[pn].shader.cur_texm != mtexid)
1659 || (gc->pipe[pn].shader.cur_prog != prog) 1675 || (gc->pipe[pn].shader.cur_prog != prog)
1660 || (gc->pipe[pn].shader.blend != blend) 1676 || (gc->pipe[pn].shader.blend != blend)
1661 || (gc->pipe[pn].shader.render_op != gc->dc->render_op) 1677 || (gc->pipe[pn].shader.render_op != gc->dc->render_op)
@@ -1665,6 +1681,7 @@ again:
1665 shader_array_flush(gc); 1681 shader_array_flush(gc);
1666 pn = gc->state.top_pipe; 1682 pn = gc->state.top_pipe;
1667 gc->pipe[pn].shader.cur_tex = 0; 1683 gc->pipe[pn].shader.cur_tex = 0;
1684 gc->pipe[pn].shader.cur_texm = mtexid;
1668 gc->pipe[pn].shader.cur_prog = prog; 1685 gc->pipe[pn].shader.cur_prog = prog;
1669 gc->pipe[pn].shader.blend = blend; 1686 gc->pipe[pn].shader.blend = blend;
1670 gc->pipe[pn].shader.render_op = gc->dc->render_op; 1687 gc->pipe[pn].shader.render_op = gc->dc->render_op;
@@ -1684,7 +1701,7 @@ again:
1684 gc->pipe[pn].array.use_texuv3 = 0; 1701 gc->pipe[pn].array.use_texuv3 = 0;
1685 gc->pipe[pn].array.use_texa = 0; 1702 gc->pipe[pn].array.use_texa = 0;
1686 gc->pipe[pn].array.use_texsam = 0; 1703 gc->pipe[pn].array.use_texsam = 0;
1687 gc->pipe[pn].array.use_texm = 0; 1704 gc->pipe[pn].array.use_texm = !!mtex;
1688#endif 1705#endif
1689 1706
1690 pipe_region_expand(gc, pn, x, y, w, h); 1707 pipe_region_expand(gc, pn, x, y, w, h);
@@ -1698,6 +1715,8 @@ again:
1698 PUSH_VERTEX(pn, x + w, y + h, 0); 1715 PUSH_VERTEX(pn, x + w, y + h, 0);
1699 PUSH_VERTEX(pn, x , y + h, 0); 1716 PUSH_VERTEX(pn, x , y + h, 0);
1700 1717
1718 PUSH_MASK(pn, mtex, mx, my, mw, mh);
1719
1701 PUSH_6_COLORS(pn, r, g, b, a); 1720 PUSH_6_COLORS(pn, r, g, b, a);
1702} 1721}
1703 1722
@@ -3175,7 +3194,7 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
3175 } 3194 }
3176 else 3195 else
3177 { 3196 {
3178 GLint MASK_TEXTURE = GL_TEXTURE1; 3197 GLint MASK_TEXTURE = GL_TEXTURE0;
3179 3198
3180 if (gc->pipe[i].array.use_texuv) 3199 if (gc->pipe[i].array.use_texuv)
3181 { 3200 {
@@ -3184,6 +3203,8 @@ shader_array_flush(Evas_Engine_GL_Context *gc)
3184 glVertexAttribPointer(SHAD_TEXUV, 2, GL_FLOAT, GL_FALSE, 0, 3203 glVertexAttribPointer(SHAD_TEXUV, 2, GL_FLOAT, GL_FALSE, 0,
3185 (void *)texuv_ptr); 3204 (void *)texuv_ptr);
3186 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 3205 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
3206
3207 MASK_TEXTURE += 1;
3187 } 3208 }
3188 else 3209 else
3189 { 3210 {
diff --git a/src/modules/evas/engines/gl_common/evas_gl_polygon.c b/src/modules/evas/engines/gl_common/evas_gl_polygon.c
index afaaad586e..0e5dd7f83a 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_polygon.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_polygon.c
@@ -139,6 +139,8 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
139 Evas_GL_Polygon_Point *pt; 139 Evas_GL_Polygon_Point *pt;
140 Eina_Inlist *spans; 140 Eina_Inlist *spans;
141 141
142 // TODO: Implement masking support (not very important right now)
143
142 /* save out clip info */ 144 /* save out clip info */
143 c = gc->dc->clip.use; cx = gc->dc->clip.x; cy = gc->dc->clip.y; cw = gc->dc->clip.w; ch = gc->dc->clip.h; 145 c = gc->dc->clip.use; cx = gc->dc->clip.x; cy = gc->dc->clip.y; cw = gc->dc->clip.w; ch = gc->dc->clip.h;
144 146
@@ -268,7 +270,9 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
268 y = span->y; 270 y = span->y;
269 w = span->w; 271 w = span->w;
270 h = 1; 272 h = 1;
271 evas_gl_common_context_rectangle_push(gc, x, y, w, h, cr, cg, cb, ca); 273 evas_gl_common_context_rectangle_push(gc, x, y, w, h,
274 cr, cg, cb, ca,
275 NULL, 0, 0, 0, 0);
272 } 276 }
273 } 277 }
274 else 278 else
@@ -290,7 +294,9 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
290 h = 1; 294 h = 1;
291 RECTS_CLIP_TO_RECT(x, y, w, h, r->x, r->y, r->w, r->h); 295 RECTS_CLIP_TO_RECT(x, y, w, h, r->x, r->y, r->w, r->h);
292 if ((w > 0) && (h > 0)) 296 if ((w > 0) && (h > 0))
293 evas_gl_common_context_rectangle_push(gc, x, y, w, h, cr, cg, cb, ca); 297 evas_gl_common_context_rectangle_push(gc, x, y, w, h,
298 cr, cg, cb, ca,
299 NULL, 0, 0, 0, 0);
294 } 300 }
295 } 301 }
296 } 302 }
diff --git a/src/modules/evas/engines/gl_common/evas_gl_rectangle.c b/src/modules/evas/engines/gl_common/evas_gl_rectangle.c
index b9ae03ab34..7ef30fc149 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_rectangle.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_rectangle.c
@@ -5,6 +5,8 @@ evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h)
5{ 5{
6 Cutout_Rect *r; 6 Cutout_Rect *r;
7 int c, cx, cy, cw, ch, cr, cg, cb, ca, i; 7 int c, cx, cy, cw, ch, cr, cg, cb, ca, i;
8 double mx = 0, my = 0, mw = 0, mh = 0;
9 Evas_GL_Texture *mtex = NULL;
8 10
9 if ((w <= 0) || (h <= 0)) return; 11 if ((w <= 0) || (h <= 0)) return;
10 if (!(RECTS_INTERSECT(x, y, w, h, 0, 0, gc->w, gc->h))) return; 12 if (!(RECTS_INTERSECT(x, y, w, h, 0, 0, gc->w, gc->h))) return;
@@ -26,9 +28,21 @@ evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h)
26 gc->dc->clip.w, gc->dc->clip.h); 28 gc->dc->clip.w, gc->dc->clip.h);
27 } 29 }
28 30
31 if (gc->dc->clip.mask)
32 {
33 Evas_GL_Image *mask = gc->dc->clip.mask;
34
35 mx = gc->dc->clip.mask_x; mw = mask->w;
36 my = gc->dc->clip.mask_y; mh = mask->h;
37 RECTS_CLIP_TO_RECT(mx, my, mw, mh, cx, cy, cw, ch);
38 mx -= gc->dc->clip.mask_x;
39 my -= gc->dc->clip.mask_y;
40 mtex = mask->tex;
41 }
42
29 if (!gc->dc->cutout.rects) 43 if (!gc->dc->cutout.rects)
30 { 44 {
31 evas_gl_common_context_rectangle_push(gc, x, y, w, h, cr, cg, cb, ca); 45 evas_gl_common_context_rectangle_push(gc, x, y, w, h, cr, cg, cb, ca, mtex, mx, my, mw, mh);
32 } 46 }
33 else 47 else
34 { 48 {
@@ -42,7 +56,7 @@ evas_gl_common_rect_draw(Evas_Engine_GL_Context *gc, int x, int y, int w, int h)
42 r = _evas_gl_common_cutout_rects->rects + i; 56 r = _evas_gl_common_cutout_rects->rects + i;
43 if ((r->w > 0) && (r->h > 0)) 57 if ((r->w > 0) && (r->h > 0))
44 { 58 {
45 evas_gl_common_context_rectangle_push(gc, r->x, r->y, r->w, r->h, cr, cg, cb, ca); 59 evas_gl_common_context_rectangle_push(gc, r->x, r->y, r->w, r->h, cr, cg, cb, ca, mtex, mx, my, mw, mh);
46 } 60 }
47 } 61 }
48 evas_common_draw_context_cutouts_free(_evas_gl_common_cutout_rects); 62 evas_common_draw_context_cutouts_free(_evas_gl_common_cutout_rects);
diff --git a/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x b/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x
index d1227ef9c6..6f0fb93d1d 100644
--- a/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x
+++ b/src/modules/evas/engines/gl_common/shader/evas_gl_enum.x
@@ -53,5 +53,6 @@ typedef enum {
53 SHADER_NV12_MASK, 53 SHADER_NV12_MASK,
54 SHADER_YUY2_MASK, 54 SHADER_YUY2_MASK,
55 SHADER_RGB_A_PAIR_MASK, 55 SHADER_RGB_A_PAIR_MASK,
56 SHADER_RECT_MASK,
56 SHADER_LAST 57 SHADER_LAST
57} Evas_GL_Shader; 58} Evas_GL_Shader;
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 08b88675d4..555bfa8335 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
@@ -2656,6 +2656,51 @@ Evas_GL_Program_Source shader_rgb_a_pair_mask_vert_src =
2656 NULL, 0 2656 NULL, 0
2657}; 2657};
2658 2658
2659/* Source: modules/evas/engines/gl_common/shader/rect_mask_frag.shd */
2660static const char const rect_mask_frag_glsl[] =
2661 "#ifdef GL_ES\n"
2662 "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
2663 "precision highp float;\n"
2664 "#else\n"
2665 "precision mediump float;\n"
2666 "#endif\n"
2667 "#endif\n"
2668 "uniform sampler2D texm;\n"
2669 "varying vec4 col;\n"
2670 "varying vec4 coord_m;\n"
2671 "void main()\n"
2672 "{\n"
2673 " gl_FragColor = texture2D(texm, coord_m.xy).a * col;\n"
2674 "}\n";
2675Evas_GL_Program_Source shader_rect_mask_frag_src =
2676{
2677 rect_mask_frag_glsl,
2678 NULL, 0
2679};
2680
2681/* Source: modules/evas/engines/gl_common/shader/rect_mask_vert.shd */
2682static const char const rect_mask_vert_glsl[] =
2683 "#ifdef GL_ES\n"
2684 "precision highp float;\n"
2685 "#endif\n"
2686 "attribute vec4 vertex;\n"
2687 "attribute vec4 color;\n"
2688 "attribute vec4 tex_coordm;\n"
2689 "uniform mat4 mvp;\n"
2690 "varying vec4 col;\n"
2691 "varying vec4 coord_m;\n"
2692 "void main()\n"
2693 "{\n"
2694 " gl_Position = mvp * vertex;\n"
2695 " col = color;\n"
2696 " coord_m = tex_coordm;\n"
2697 "}\n";
2698Evas_GL_Program_Source shader_rect_mask_vert_src =
2699{
2700 rect_mask_vert_glsl,
2701 NULL, 0
2702};
2703
2659static const struct { 2704static const struct {
2660 Evas_GL_Shader id; 2705 Evas_GL_Shader id;
2661 Evas_GL_Program_Source *vert; 2706 Evas_GL_Program_Source *vert;
@@ -2713,5 +2758,6 @@ static const struct {
2713 { SHADER_NV12_MASK, &(shader_nv12_mask_vert_src), &(shader_nv12_mask_frag_src), "nv12_mask" }, 2758 { SHADER_NV12_MASK, &(shader_nv12_mask_vert_src), &(shader_nv12_mask_frag_src), "nv12_mask" },
2714 { SHADER_YUY2_MASK, &(shader_yuy2_mask_vert_src), &(shader_yuy2_mask_frag_src), "yuy2_mask" }, 2759 { SHADER_YUY2_MASK, &(shader_yuy2_mask_vert_src), &(shader_yuy2_mask_frag_src), "yuy2_mask" },
2715 { SHADER_RGB_A_PAIR_MASK, &(shader_rgb_a_pair_mask_vert_src), &(shader_rgb_a_pair_mask_frag_src), "rgb_a_pair_mask" }, 2760 { SHADER_RGB_A_PAIR_MASK, &(shader_rgb_a_pair_mask_vert_src), &(shader_rgb_a_pair_mask_frag_src), "rgb_a_pair_mask" },
2761 { SHADER_RECT_MASK, &(shader_rect_mask_vert_src), &(shader_rect_mask_frag_src), "rect_mask" },
2716}; 2762};
2717 2763
diff --git a/src/modules/evas/engines/gl_common/shader/rect_mask_frag.shd b/src/modules/evas/engines/gl_common/shader/rect_mask_frag.shd
new file mode 100644
index 0000000000..e278ea63e7
--- /dev/null
+++ b/src/modules/evas/engines/gl_common/shader/rect_mask_frag.shd
@@ -0,0 +1,14 @@
1#ifdef GL_ES
2#ifdef GL_FRAGMENT_PRECISION_HIGH
3precision highp float;
4#else
5precision mediump float;
6#endif
7#endif
8uniform sampler2D texm;
9varying vec4 col;
10varying vec4 coord_m;
11void main()
12{
13 gl_FragColor = texture2D(texm, coord_m.xy).a * col;
14}
diff --git a/src/modules/evas/engines/gl_common/shader/rect_mask_vert.shd b/src/modules/evas/engines/gl_common/shader/rect_mask_vert.shd
new file mode 100644
index 0000000000..4a1dd2cc8c
--- /dev/null
+++ b/src/modules/evas/engines/gl_common/shader/rect_mask_vert.shd
@@ -0,0 +1,15 @@
1#ifdef GL_ES
2precision highp float;
3#endif
4attribute vec4 vertex;
5attribute vec4 color;
6attribute vec4 tex_coordm;
7uniform mat4 mvp;
8varying vec4 col;
9varying vec4 coord_m;
10void main()
11{
12 gl_Position = mvp * vertex;
13 col = color;
14 coord_m = tex_coordm;
15}