summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common/evas_gl_polygon.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-01-24 14:23:03 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-04-14 11:26:43 +0900
commit3d2f1a3d9b04d4067ebe6008d2662c46ec694d7b (patch)
treeadcdba47ffe0813684dc6379d1328102736adc67 /src/modules/evas/engines/gl_common/evas_gl_polygon.c
parent92dfe1831cc8a5f53c65ef5b0893eb05d2476e45 (diff)
evas filters: Implement mask filter in pure GL
This reuses the existing mask infrastructure, but adds a color flag to use the whole RGBA range, rather than just the Alpha channel. Filters are still very slow (glReadPixels and non-optimized use of GL buffers...), but this is progress :)
Diffstat (limited to 'src/modules/evas/engines/gl_common/evas_gl_polygon.c')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_polygon.c8
1 files changed, 6 insertions, 2 deletions
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 4552d66..839dc61 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_polygon.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_polygon.c
@@ -133,6 +133,7 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
133 int x = 0, y = 0, w = 0, h = 0; 133 int x = 0, y = 0, w = 0, h = 0;
134 Evas_GL_Texture *mtex = NULL; 134 Evas_GL_Texture *mtex = NULL;
135 Eina_Bool mask_smooth = EINA_FALSE; 135 Eina_Bool mask_smooth = EINA_FALSE;
136 Eina_Bool mask_color = EINA_FALSE;
136 int mx = 0, my = 0, mw = 0, mh = 0; 137 int mx = 0, my = 0, mw = 0, mh = 0;
137 Evas_GL_Image *mask; 138 Evas_GL_Image *mask;
138 139
@@ -165,6 +166,7 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
165 mw = mask->w; 166 mw = mask->w;
166 mh = mask->h; 167 mh = mask->h;
167 mask_smooth = mask->scaled.smooth; 168 mask_smooth = mask->scaled.smooth;
169 mask_color = gc->dc->clip.mask_color;
168 } 170 }
169 else mtex = NULL; 171 else mtex = NULL;
170 } 172 }
@@ -291,7 +293,8 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
291 h = 1; 293 h = 1;
292 evas_gl_common_context_rectangle_push(gc, x, y, w, h, 294 evas_gl_common_context_rectangle_push(gc, x, y, w, h,
293 cr, cg, cb, ca, 295 cr, cg, cb, ca,
294 mtex, mx, my, mw, mh, mask_smooth); 296 mtex, mx, my, mw, mh,
297 mask_smooth, mask_color);
295 } 298 }
296 } 299 }
297 else 300 else
@@ -315,7 +318,8 @@ evas_gl_common_poly_draw(Evas_Engine_GL_Context *gc, Evas_GL_Polygon *poly, int
315 if ((w > 0) && (h > 0)) 318 if ((w > 0) && (h > 0))
316 evas_gl_common_context_rectangle_push(gc, x, y, w, h, 319 evas_gl_common_context_rectangle_push(gc, x, y, w, h,
317 cr, cg, cb, ca, 320 cr, cg, cb, ca,
318 mtex, mx, my, mw, mh, mask_smooth); 321 mtex, mx, my, mw, mh,
322 mask_smooth, mask_color);
319 } 323 }
320 } 324 }
321 } 325 }