summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-01-05 13:44:32 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-01-07 15:06:03 +0900
commitbb923d5586bc43aac7ab362da0b5991873bfab27 (patch)
tree4f385aada1433154d69bd870ed84ada837b13a4a /src/modules
parentf876cf31f8d6fd48f7602bd593c24c1a07138d8f (diff)
Evas masking: Minor fixes in GL masking
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_common.h33
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_context.c20
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c16
3 files changed, 14 insertions, 55 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 421bd14918..456d42d86b 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_common.h
+++ b/src/modules/evas/engines/gl_common/evas_gl_common.h
@@ -630,39 +630,6 @@ struct _Evas_GL_Texture_Async_Preload
630 Eina_Bool unpack_row_length; 630 Eina_Bool unpack_row_length;
631}; 631};
632 632
633#if 0
634extern Evas_GL_Program_Source shader_rect_frag_src;
635extern Evas_GL_Program_Source shader_rect_vert_src;
636extern Evas_GL_Program_Source shader_font_frag_src;
637extern Evas_GL_Program_Source shader_font_vert_src;
638
639extern Evas_GL_Program_Source shader_img_frag_src;
640extern Evas_GL_Program_Source shader_img_vert_src;
641extern Evas_GL_Program_Source shader_img_nomul_frag_src;
642extern Evas_GL_Program_Source shader_img_nomul_vert_src;
643extern Evas_GL_Program_Source shader_img_bgra_frag_src;
644extern Evas_GL_Program_Source shader_img_bgra_vert_src;
645extern Evas_GL_Program_Source shader_img_bgra_nomul_frag_src;
646extern Evas_GL_Program_Source shader_img_bgra_nomul_vert_src;
647extern Evas_GL_Program_Source shader_img_mask_frag_src;
648extern Evas_GL_Program_Source shader_img_mask_vert_src;
649
650extern Evas_GL_Program_Source shader_yuv_frag_src;
651extern Evas_GL_Program_Source shader_yuv_vert_src;
652extern Evas_GL_Program_Source shader_yuv_nomul_frag_src;
653extern Evas_GL_Program_Source shader_yuv_nomul_vert_src;
654
655extern Evas_GL_Program_Source shader_yuy2_frag_src;
656extern Evas_GL_Program_Source shader_yuy2_vert_src;
657extern Evas_GL_Program_Source shader_yuy2_nomul_frag_src;
658extern Evas_GL_Program_Source shader_yuy2_nomul_vert_src;
659
660extern Evas_GL_Program_Source shader_tex_frag_src;
661extern Evas_GL_Program_Source shader_tex_vert_src;
662extern Evas_GL_Program_Source shader_tex_nomul_frag_src;
663extern Evas_GL_Program_Source shader_tex_nomul_vert_src;
664#endif
665
666/* GL_Common function that are used by gl_generic inherited module */ 633/* GL_Common function that are used by gl_generic inherited module */
667EAPI void evas_gl_common_image_all_unload(Evas_Engine_GL_Context *gc); 634EAPI void evas_gl_common_image_all_unload(Evas_Engine_GL_Context *gc);
668EAPI void evas_gl_common_image_ref(Evas_GL_Image *im); 635EAPI void evas_gl_common_image_ref(Evas_GL_Image *im);
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 2adc874e2f..7141920d64 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_context.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_context.c
@@ -1414,6 +1414,7 @@ static int
1414_evas_gl_common_context_push(int rtype, 1414_evas_gl_common_context_push(int rtype,
1415 Evas_Engine_GL_Context *gc, 1415 Evas_Engine_GL_Context *gc,
1416 Evas_GL_Texture *tex, 1416 Evas_GL_Texture *tex,
1417 Evas_GL_Texture *texm,
1417 GLuint prog, 1418 GLuint prog,
1418 int x, int y, int w, int h, 1419 int x, int y, int w, int h,
1419 Eina_Bool blend, 1420 Eina_Bool blend,
@@ -1442,6 +1443,7 @@ _evas_gl_common_context_push(int rtype,
1442 { 1443 {
1443 if ((gc->pipe[i].region.type == rtype) 1444 if ((gc->pipe[i].region.type == rtype)
1444 && (!tex || gc->pipe[i].shader.cur_tex == current_tex) 1445 && (!tex || gc->pipe[i].shader.cur_tex == current_tex)
1446 && (!texm || gc->pipe[i].shader.cur_texm == texm->pt->texture)
1445 && (gc->pipe[i].shader.cur_prog == prog) 1447 && (gc->pipe[i].shader.cur_prog == prog)
1446 && (gc->pipe[i].shader.smooth == smooth) 1448 && (gc->pipe[i].shader.smooth == smooth)
1447 && (gc->pipe[i].shader.blend == blend) 1449 && (gc->pipe[i].shader.blend == blend)
@@ -1519,6 +1521,8 @@ evas_gl_common_context_line_push(Evas_Engine_GL_Context *gc,
1519 GLuint prog = gc->shared->shader[SHADER_RECT].prog; 1521 GLuint prog = gc->shared->shader[SHADER_RECT].prog;
1520 int pn = 0, i; 1522 int pn = 0, i;
1521 1523
1524 // FIXME: Line masking is not implemented
1525
1522 if (!(gc->dc->render_op == EVAS_RENDER_COPY) && (a < 255)) 1526 if (!(gc->dc->render_op == EVAS_RENDER_COPY) && (a < 255))
1523 blend = EINA_TRUE; 1527 blend = EINA_TRUE;
1524 1528
@@ -1910,7 +1914,7 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
1910 } 1914 }
1911 1915
1912 pn = _evas_gl_common_context_push(RTYPE_IMAGE, 1916 pn = _evas_gl_common_context_push(RTYPE_IMAGE,
1913 gc, tex, 1917 gc, tex, mtex,
1914 prog, 1918 prog,
1915 x, y, w, h, 1919 x, y, w, h,
1916 blend, 1920 blend,
@@ -1981,7 +1985,7 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
1981 PUSH_TEXSAM(pn, samx, samy); 1985 PUSH_TEXSAM(pn, samx, samy);
1982 PUSH_TEXSAM(pn, samx, samy); 1986 PUSH_TEXSAM(pn, samx, samy);
1983 PUSH_TEXSAM(pn, samx, samy); 1987 PUSH_TEXSAM(pn, samx, samy);
1984 1988
1985 PUSH_TEXSAM(pn, samx, samy); 1989 PUSH_TEXSAM(pn, samx, samy);
1986 PUSH_TEXSAM(pn, samx, samy); 1990 PUSH_TEXSAM(pn, samx, samy);
1987 PUSH_TEXSAM(pn, samx, samy); 1991 PUSH_TEXSAM(pn, samx, samy);
@@ -2011,7 +2015,7 @@ evas_gl_common_context_font_push(Evas_Engine_GL_Context *gc,
2011 prog = gc->shared->shader[SHADER_FONT_MASK].prog; 2015 prog = gc->shared->shader[SHADER_FONT_MASK].prog;
2012 2016
2013 pn = _evas_gl_common_context_push(RTYPE_FONT, 2017 pn = _evas_gl_common_context_push(RTYPE_FONT,
2014 gc, tex, 2018 gc, tex, mtex,
2015 prog, 2019 prog,
2016 x, y, w, h, 2020 x, y, w, h,
2017 1, 2021 1,
@@ -2100,7 +2104,7 @@ evas_gl_common_context_yuv_push(Evas_Engine_GL_Context *gc,
2100 SHADER_YUV_MASK, SHADER_YUV_MASK)].prog; 2104 SHADER_YUV_MASK, SHADER_YUV_MASK)].prog;
2101 2105
2102 pn = _evas_gl_common_context_push(RTYPE_YUV, 2106 pn = _evas_gl_common_context_push(RTYPE_YUV,
2103 gc, tex, 2107 gc, tex, mtex,
2104 prog, 2108 prog,
2105 x, y, w, h, 2109 x, y, w, h,
2106 blend, 2110 blend,
@@ -2202,7 +2206,7 @@ evas_gl_common_context_yuy2_push(Evas_Engine_GL_Context *gc,
2202 SHADER_YUY2_MASK, SHADER_YUY2_MASK)].prog; 2206 SHADER_YUY2_MASK, SHADER_YUY2_MASK)].prog;
2203 2207
2204 pn = _evas_gl_common_context_push(RTYPE_YUY2, 2208 pn = _evas_gl_common_context_push(RTYPE_YUY2,
2205 gc, tex, 2209 gc, tex, mtex,
2206 prog, 2210 prog,
2207 x, y, w, h, 2211 x, y, w, h,
2208 blend, 2212 blend,
@@ -2295,7 +2299,7 @@ evas_gl_common_context_nv12_push(Evas_Engine_GL_Context *gc,
2295 SHADER_NV12_MASK, SHADER_NV12_MASK)].prog; 2299 SHADER_NV12_MASK, SHADER_NV12_MASK)].prog;
2296 2300
2297 pn = _evas_gl_common_context_push(RTYPE_NV12, 2301 pn = _evas_gl_common_context_push(RTYPE_NV12,
2298 gc, tex, 2302 gc, tex, mtex,
2299 prog, 2303 prog,
2300 x, y, w, h, 2304 x, y, w, h,
2301 blend, 2305 blend,
@@ -2396,7 +2400,7 @@ evas_gl_common_context_rgb_a_pair_push(Evas_Engine_GL_Context *gc,
2396 SHADER_RGB_A_PAIR_MASK, SHADER_RGB_A_PAIR_MASK)].prog; 2400 SHADER_RGB_A_PAIR_MASK, SHADER_RGB_A_PAIR_MASK)].prog;
2397 2401
2398 pn = _evas_gl_common_context_push(RTYPE_IMAGE, 2402 pn = _evas_gl_common_context_push(RTYPE_IMAGE,
2399 gc, tex, 2403 gc, tex, mtex,
2400 prog, 2404 prog,
2401 x, y, w, h, 2405 x, y, w, h,
2402 EINA_TRUE, 2406 EINA_TRUE,
@@ -2630,7 +2634,7 @@ evas_gl_common_context_image_map_push(Evas_Engine_GL_Context *gc,
2630 } 2634 }
2631 2635
2632 pn = _evas_gl_common_context_push(RTYPE_MAP, 2636 pn = _evas_gl_common_context_push(RTYPE_MAP,
2633 gc, tex, 2637 gc, tex, mtex,
2634 prog, 2638 prog,
2635 x, y, w, h, 2639 x, y, w, h,
2636 blend, 2640 blend,
diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c
index 791cdacfef..6478ab0604 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -1117,7 +1117,7 @@ evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx,
1117 mask_y = dc->clip.mask_y; 1117 mask_y = dc->clip.mask_y;
1118 if (mask) 1118 if (mask)
1119 { 1119 {
1120 evas_gl_common_image_update(gc, im); 1120 evas_gl_common_image_update(gc, mask);
1121 if (!mask->tex) 1121 if (!mask->tex)
1122 { 1122 {
1123 ERR("Failed to apply mask image"); 1123 ERR("Failed to apply mask image");
@@ -1160,19 +1160,7 @@ evas_gl_common_image_draw(Evas_Engine_GL_Context *gc, Evas_GL_Image *im, int sx,
1160 ((gc->shared->info.tune.cutout.max > 0) && 1160 ((gc->shared->info.tune.cutout.max > 0) &&
1161 (gc->dc->cutout.active > gc->shared->info.tune.cutout.max))) 1161 (gc->dc->cutout.active > gc->shared->info.tune.cutout.max)))
1162 { 1162 {
1163 if (mask) 1163 if (mask || gc->dc->clip.use)
1164 {
1165 _evas_gl_common_image_push(gc, im,
1166 dx, dy, dw, dh,
1167 sx, sy, sw, sh,
1168 gc->dc->clip.x, gc->dc->clip.y,
1169 gc->dc->clip.w, gc->dc->clip.h,
1170 r, g, b, a,
1171 mask, mask_x, mask_y,
1172 smooth,
1173 yuv, yuy2, nv12, rgb_a_pair);
1174 }
1175 else if (gc->dc->clip.use)
1176 { 1164 {
1177 _evas_gl_common_image_push(gc, im, 1165 _evas_gl_common_image_push(gc, im,
1178 dx, dy, dw, dh, 1166 dx, dy, dw, dh,