summaryrefslogtreecommitdiff
path: root/src/lib/evas/common
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/lib/evas/common
parent437ae4a3d3b0d00a279fb93f4341c9205d785c36 (diff)
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/lib/evas/common')
-rw-r--r--src/lib/evas/common/evas_draw.h4
-rw-r--r--src/lib/evas/common/evas_draw_main.c6
-rw-r--r--src/lib/evas/common/evas_font_draw.c10
3 files changed, 9 insertions, 11 deletions
diff --git a/src/lib/evas/common/evas_draw.h b/src/lib/evas/common/evas_draw.h
index 6323e8d674..28b7c9429f 100644
--- a/src/lib/evas/common/evas_draw.h
+++ b/src/lib/evas/common/evas_draw.h
@@ -12,9 +12,9 @@ EAPI void evas_common_draw_context_font_ext_set (RGBA_D
12 void *(*gl_new) (void *data, RGBA_Font_Glyph *fg), 12 void *(*gl_new) (void *data, RGBA_Font_Glyph *fg),
13 void (*gl_free) (void *ext_dat), 13 void (*gl_free) (void *ext_dat),
14 void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y), 14 void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y),
15 void *(*gl_image_new_from_data) (void *gc, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace), 15 void *(*gl_image_new) (void *gc, RGBA_Font_Glyph *fg, int alpha, Evas_Colorspace cspace),
16 void (*gl_image_free) (void *image), 16 void (*gl_image_free) (void *image),
17 void (*gl_image_draw) (void *gc, void *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth)); 17 void (*gl_image_draw) (void *gc, void *im, int dx, int dy, int dw, int dh, int smooth));
18EAPI void evas_common_draw_context_clip_clip (RGBA_Draw_Context *dc, int x, int y, int w, int h); 18EAPI void evas_common_draw_context_clip_clip (RGBA_Draw_Context *dc, int x, int y, int w, int h);
19EAPI void evas_common_draw_context_set_clip (RGBA_Draw_Context *dc, int x, int y, int w, int h); 19EAPI void evas_common_draw_context_set_clip (RGBA_Draw_Context *dc, int x, int y, int w, int h);
20EAPI void evas_common_draw_context_unset_clip (RGBA_Draw_Context *dc); 20EAPI void evas_common_draw_context_unset_clip (RGBA_Draw_Context *dc);
diff --git a/src/lib/evas/common/evas_draw_main.c b/src/lib/evas/common/evas_draw_main.c
index d7c26c73f5..d6b0a8942b 100644
--- a/src/lib/evas/common/evas_draw_main.c
+++ b/src/lib/evas/common/evas_draw_main.c
@@ -216,15 +216,15 @@ evas_common_draw_context_font_ext_set(RGBA_Draw_Context *dc,
216 void *(*gl_new) (void *data, RGBA_Font_Glyph *fg), 216 void *(*gl_new) (void *data, RGBA_Font_Glyph *fg),
217 void (*gl_free) (void *ext_dat), 217 void (*gl_free) (void *ext_dat),
218 void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y), 218 void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y),
219 void *(*gl_image_new_from_data) (void *gc, unsigned int w, unsigned int h, DATA32 *image_data, int alpha, Evas_Colorspace cspace), 219 void *(*gl_image_new) (void *gc, RGBA_Font_Glyph *fg, int alpha, Evas_Colorspace cspace),
220 void (*gl_image_free) (void *image), 220 void (*gl_image_free) (void *image),
221 void (*gl_image_draw) (void *gc, void *im, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh, int smooth)) 221 void (*gl_image_draw) (void *gc, void *im, int dx, int dy, int dw, int dh, int smooth))
222{ 222{
223 dc->font_ext.data = data; 223 dc->font_ext.data = data;
224 dc->font_ext.func.gl_new = gl_new; 224 dc->font_ext.func.gl_new = gl_new;
225 dc->font_ext.func.gl_free = gl_free; 225 dc->font_ext.func.gl_free = gl_free;
226 dc->font_ext.func.gl_draw = gl_draw; 226 dc->font_ext.func.gl_draw = gl_draw;
227 dc->font_ext.func.gl_image_new_from_data = gl_image_new_from_data; 227 dc->font_ext.func.gl_image_new = gl_image_new;
228 dc->font_ext.func.gl_image_free = gl_image_free; 228 dc->font_ext.func.gl_image_free = gl_image_free;
229 dc->font_ext.func.gl_image_draw = gl_image_draw; 229 dc->font_ext.func.gl_image_draw = gl_image_draw;
230} 230}
diff --git a/src/lib/evas/common/evas_font_draw.c b/src/lib/evas/common/evas_font_draw.c
index b4b0a994d9..f7fcb13bd8 100644
--- a/src/lib/evas/common/evas_font_draw.c
+++ b/src/lib/evas/common/evas_font_draw.c
@@ -123,13 +123,11 @@ evas_common_font_rgba_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y,
123 123
124 if ((!fg->ext_dat) && FT_HAS_COLOR(fg->fi->src->ft.face)) 124 if ((!fg->ext_dat) && FT_HAS_COLOR(fg->fi->src->ft.face))
125 { 125 {
126 if (dc->font_ext.func.gl_image_new_from_data) 126 if (dc->font_ext.func.gl_image_new)
127 { 127 {
128 /* extension calls */ 128 /* extension calls */
129 fg->ext_dat = dc->font_ext.func.gl_image_new_from_data 129 fg->ext_dat = dc->font_ext.func.gl_image_new
130 (dc->font_ext.data, (unsigned int)w, (unsigned int)h, 130 (dc->font_ext.data, fg, EINA_TRUE, EVAS_COLORSPACE_ARGB8888);
131 (DATA32 *)fg->glyph_out->bitmap.buffer, EINA_TRUE,
132 EVAS_COLORSPACE_ARGB8888);
133 fg->ext_dat_free = dc->font_ext.func.gl_image_free; 131 fg->ext_dat_free = dc->font_ext.func.gl_image_free;
134 } 132 }
135 else 133 else
@@ -163,7 +161,7 @@ evas_common_font_rgba_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y,
163 { 161 {
164 if (dc->font_ext.func.gl_image_draw) 162 if (dc->font_ext.func.gl_image_draw)
165 dc->font_ext.func.gl_image_draw 163 dc->font_ext.func.gl_image_draw
166 (dc->font_ext.data, fg->ext_dat, 0, 0, w, h, 164 (dc->font_ext.data, fg->ext_dat,
167 chr_x, y - (chr_y - y), w, h, EINA_TRUE); 165 chr_x, y - (chr_y - y), w, h, EINA_TRUE);
168 else 166 else
169 _evas_font_image_draw 167 _evas_font_image_draw