evas: clear the previous engine's data for color emoticon 67/115567/1
authorYoungbok Shin <youngb.shin@samsung.com>
Mon, 20 Feb 2017 09:12:35 +0000 (18:12 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Mon, 20 Feb 2017 10:27:26 +0000 (02:27 -0800)
Changing rendering engine in a running process could cause crash issues.
The image data for emoticons should be saved seperately or
should be refreshed when different engine is loaded.

@tizen_fix

Change-Id: I4ba98118cac8c69bdf722416443cd2141686bc5b
(cherry picked from commit 617a8c8793d1fff6ff3eb2bfb551e41c8b153c0b)

src/lib/evas/common/evas_font_draw.c

index 361b690..03671b6 100644 (file)
@@ -114,6 +114,20 @@ evas_common_font_rgba_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y,
         w = fg->glyph_out->bitmap.width;
         h = fg->glyph_out->bitmap.rows;
 
+        /* TIZEN_ONLY(20170220): clear the previous engine's data for color emoticon */
+        if (fg->ext_dat && FT_HAS_COLOR(fg->fi->src->ft.face))
+          {
+             if (((fg->ext_dat_free == _evas_font_image_free) &&
+                  dc->font_ext.func.gl_image_new_from_data) ||
+                 ((fg->ext_dat_free != _evas_font_image_free) &&
+                  !dc->font_ext.func.gl_image_new_from_data))
+               {
+                  fg->ext_dat_free(fg->ext_dat);
+                  fg->ext_dat = NULL;
+               }
+          }
+        /* END */
+
         if ((!fg->ext_dat) && (dc->font_ext.func.gl_new))
           {
              /* extension calls */