aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/evas/engines/gl_common/evas_gl_font.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_font.c
parentevas filters: Fix blur logic and GL buffer handling (diff)
downloadefl-3d2f1a3d9b04d4067ebe6008d2662c46ec694d7b.tar.gz
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_font.c')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_font.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_font.c b/src/modules/evas/engines/gl_common/evas_gl_font.c
index 5a5fdeb730..1b3e35b607 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_font.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_font.c
@@ -71,6 +71,7 @@ evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_c
int sx, sy, sw, sh;
double mx = 0.0, my = 0.0, mw = 0.0, mh = 0.0;
Eina_Bool mask_smooth = EINA_FALSE;
+ Eina_Bool mask_color = EINA_FALSE;
if (dc != gc->dc) return;
tex = fg->ext_dat;
@@ -94,6 +95,7 @@ evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_c
mw = mask->w;
mh = mask->h;
mask_smooth = mask->scaled.smooth;
+ mask_color = gc->dc->clip.mask_color;
}
else mtex = NULL;
}
@@ -117,7 +119,7 @@ evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_c
0.0, 0.0, 0.0, 0.0,
// sx, sy, sw, sh,
x, y, tex->w, tex->h,
- mtex, mx, my, mw, mh, mask_smooth,
+ mtex, mx, my, mw, mh, mask_smooth, mask_color,
r, g, b, a);
return;
}
@@ -128,7 +130,7 @@ evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_c
evas_gl_common_context_font_push(gc, tex,
ssx, ssy, ssw, ssh,
nx, ny, nw, nh,
- mtex, mx, my, mw, mh, mask_smooth,
+ mtex, mx, my, mw, mh, mask_smooth, mask_color,
r, g, b, a);
}
else
@@ -137,7 +139,7 @@ evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_c
0.0, 0.0, 0.0, 0.0,
// sx, sy, sw, sh,
x, y, tex->w, tex->h,
- mtex, mx, my, mw, mh, mask_smooth,
+ mtex, mx, my, mw, mh, mask_smooth, mask_color,
r, g, b, a);
}
return;
@@ -167,7 +169,7 @@ evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_c
0.0, 0.0, 0.0, 0.0,
// sx, sy, sw, sh,
x, y, tex->w, tex->h,
- mtex, mx, my, mw, mh, mask_smooth,
+ mtex, mx, my, mw, mh, mask_smooth, mask_color,
r, g, b, a);
continue;
}
@@ -178,7 +180,7 @@ evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_c
evas_gl_common_context_font_push(gc, tex,
ssx, ssy, ssw, ssh,
nx, ny, nw, nh,
- mtex, mx, my, mw, mh, mask_smooth,
+ mtex, mx, my, mw, mh, mask_smooth, mask_color,
r, g, b, a);
}
evas_common_draw_context_cutouts_free(_evas_gl_common_cutout_rects);