aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/evas/engines/gl_common/evas_gl_font.c
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2017-03-08 19:33:15 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-03-08 19:35:03 +0900
commitf83ce20e1c72c3a645553feeea640e0c4b69e6c1 (patch)
tree50e5634b68cfd67d5f7ecee92616750f50ef65c0 /src/modules/evas/engines/gl_common/evas_gl_font.c
parentelm_test: Add a test case for Emojis (diff)
downloadefl-f83ce20e1c72c3a645553feeea640e0c4b69e6c1.tar.gz
evas: clean up GL images for emojis when GL context is free'd
If GL context is free'd before processing font shutdown, textures for emoji glyph's GL images will be free'd without clean up its GL images. It causes eina mempool infinite loop issue when emoji's GL images are free'd in shutdown process. So, the patch will make a list for emoji's GL images in context and clean up them when the context is free'd. Just like font textures in context. @fix Differential Revision: https://phab.enlightenment.org/D4695 Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
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.c41
1 files changed, 41 insertions, 0 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 968168d9b5..5a5fdeb730 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_font.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_font.c
@@ -185,3 +185,44 @@ evas_gl_font_texture_draw(void *context, void *surface EINA_UNUSED, void *draw_c
/* restore clip info */
gc->dc->clip.use = c; gc->dc->clip.x = cx; gc->dc->clip.y = cy; gc->dc->clip.w = cw; gc->dc->clip.h = ch;
}
+
+void *
+evas_gl_font_image_new(void *gc, RGBA_Font_Glyph *fg, int alpha, Evas_Colorspace cspace)
+{
+ Evas_Engine_GL_Context *context = (Evas_Engine_GL_Context *)gc;
+ Evas_GL_Image *im = evas_gl_common_image_new_from_data(context,
+ (unsigned int)fg->glyph_out->bitmap.width,
+ (unsigned int)fg->glyph_out->bitmap.rows,
+ (DATA32 *)fg->glyph_out->bitmap.buffer,
+ alpha,
+ cspace);
+
+ if (im)
+ {
+ im->fglyph = fg;
+ context->font_glyph_images = eina_list_append(context->font_glyph_images, im);
+ }
+
+ return (void *)im;
+}
+
+void
+evas_gl_font_image_free(void *im)
+{
+ evas_gl_common_image_free((Evas_GL_Image *)im);
+}
+
+void
+evas_gl_font_image_draw(void *gc, void *gl_image, int dx, int dy, int dw, int dh, int smooth)
+{
+ Evas_GL_Image *im = (Evas_GL_Image *)gl_image;
+
+ if (!im || !im->fglyph) return;
+
+ evas_gl_common_image_draw((Evas_Engine_GL_Context *)gc,
+ im, 0, 0,
+ (unsigned int)im->fglyph->glyph_out->bitmap.width,
+ (unsigned int)im->fglyph->glyph_out->bitmap.rows,
+ dx, dy, dw, dh,
+ smooth);
+}