summaryrefslogtreecommitdiff
path: root/legacy/evas
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-08-14 08:31:59 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-08-14 08:31:59 +0000
commit54650e7e5615f171f0c9e63c2f145e03be3289dd (patch)
tree72deb9c5c5bf54ed4f6ff4dd1621d239bdebcadc /legacy/evas
parentb11b7c3ac49f338f90269164dda24f100f7c10d6 (diff)
fix font glyph issue when gl enignes shut down leaving font glyph data
for textures in the font core. SVN revision: 75243
Diffstat (limited to 'legacy/evas')
-rw-r--r--legacy/evas/src/modules/engines/gl_common/evas_gl_common.h3
-rw-r--r--legacy/evas/src/modules/engines/gl_common/evas_gl_context.c9
-rw-r--r--legacy/evas/src/modules/engines/gl_common/evas_gl_font.c2
-rw-r--r--legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c10
4 files changed, 19 insertions, 5 deletions
diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h b/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h
index 419774612e..0097d790ba 100644
--- a/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h
+++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_common.h
@@ -336,6 +336,8 @@ struct _Evas_Engine_GL_Context
336 struct { 336 struct {
337 Eina_Bool size : 1; 337 Eina_Bool size : 1;
338 } change; 338 } change;
339
340 Eina_List *font_glyph_textures;
339 341
340 Eina_Bool havestuff : 1; 342 Eina_Bool havestuff : 1;
341 343
@@ -377,6 +379,7 @@ struct _Evas_GL_Texture
377 Evas_Engine_GL_Context *gc; 379 Evas_Engine_GL_Context *gc;
378 Evas_GL_Image *im; 380 Evas_GL_Image *im;
379 Evas_GL_Texture_Pool *pt, *ptu, *ptv, *ptuv; 381 Evas_GL_Texture_Pool *pt, *ptu, *ptv, *ptuv;
382 RGBA_Font_Glyph *fglyph;
380 int x, y, w, h; 383 int x, y, w, h;
381 double sx1, sy1, sx2, sy2; 384 double sx1, sy1, sx2, sy2;
382 int references; 385 int references;
diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c
index 2cd55a68f6..fe965b5d54 100644
--- a/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c
+++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_context.c
@@ -770,6 +770,9 @@ evas_gl_common_context_free(Evas_Engine_GL_Context *gc)
770 if (gc->pipe[i].array.texuv3) free(gc->pipe[i].array.texuv3); 770 if (gc->pipe[i].array.texuv3) free(gc->pipe[i].array.texuv3);
771 } 771 }
772 } 772 }
773
774 while (gc->font_glyph_textures)
775 evas_gl_common_texture_free(gc->font_glyph_textures->data);
773 776
774 if ((gc->shared) && (gc->shared->references == 0)) 777 if ((gc->shared) && (gc->shared->references == 0))
775 { 778 {
@@ -783,16 +786,18 @@ evas_gl_common_context_free(Evas_Engine_GL_Context *gc)
783 evas_gl_common_image_free(gc->shared->images->data); 786 evas_gl_common_image_free(gc->shared->images->data);
784 } 787 }
785 788
786 EINA_LIST_FOREACH(gc->shared->tex.whole, l, pt)
787 evas_gl_texture_pool_empty(pt);
788 for (i = 0; i < 33; i++) 789 for (i = 0; i < 33; i++)
789 { 790 {
790 for (j = 0; j < 3; j++) 791 for (j = 0; j < 3; j++)
791 { 792 {
792 EINA_LIST_FOREACH(gc->shared->tex.atlas[i][j], l, pt) 793 EINA_LIST_FOREACH(gc->shared->tex.atlas[i][j], l, pt)
793 evas_gl_texture_pool_empty(pt); 794 evas_gl_texture_pool_empty(pt);
795 eina_list_free(gc->shared->tex.atlas[i][j]);
794 } 796 }
795 } 797 }
798 EINA_LIST_FOREACH(gc->shared->tex.whole, l, pt)
799 evas_gl_texture_pool_empty(pt);
800 eina_list_free(gc->shared->tex.whole);
796 eina_hash_free(gc->shared->native_pm_hash); 801 eina_hash_free(gc->shared->native_pm_hash);
797 eina_hash_free(gc->shared->native_tex_hash); 802 eina_hash_free(gc->shared->native_tex_hash);
798 free(gc->shared); 803 free(gc->shared);
diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_font.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_font.c
index 78eddc6f24..d3b4ba443f 100644
--- a/legacy/evas/src/modules/engines/gl_common/evas_gl_font.c
+++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_font.c
@@ -87,6 +87,8 @@ evas_gl_font_texture_new(void *context, RGBA_Font_Glyph *fg)
87 tex->sy1 = ((double)(tex->y)) / (double)tex->pt->h; 87 tex->sy1 = ((double)(tex->y)) / (double)tex->pt->h;
88 tex->sx2 = ((double)(tex->x + tex->w)) / (double)tex->pt->w; 88 tex->sx2 = ((double)(tex->x + tex->w)) / (double)tex->pt->w;
89 tex->sy2 = ((double)(tex->y + tex->h)) / (double)tex->pt->h; 89 tex->sy2 = ((double)(tex->y + tex->h)) / (double)tex->pt->h;
90 tex->fglyph = fg;
91 gc->font_glyph_textures = eina_list_append(gc->font_glyph_textures, tex);
90 return tex; 92 return tex;
91} 93}
92 94
diff --git a/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c b/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c
index 327c395f0c..4311f33097 100644
--- a/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c
+++ b/legacy/evas/src/modules/engines/gl_common/evas_gl_texture.c
@@ -675,9 +675,7 @@ evas_gl_texture_pool_empty(Evas_GL_Texture_Pool *pt)
675 GLERR(__FUNCTION__, __FILE__, __LINE__, ""); 675 GLERR(__FUNCTION__, __FILE__, __LINE__, "");
676 pt->fb = 0; 676 pt->fb = 0;
677 } 677 }
678 while (pt->allocations) 678 pt->allocations = eina_list_free(pt->allocations);
679 pt->allocations =
680 eina_list_remove_list(pt->allocations, pt->allocations);
681 pt->texture = 0; 679 pt->texture = 0;
682 pt->gc = NULL; 680 pt->gc = NULL;
683 pt->w = 0; 681 pt->w = 0;
@@ -965,6 +963,12 @@ evas_gl_common_texture_free(Evas_GL_Texture *tex)
965 if (!tex) return; 963 if (!tex) return;
966 tex->references--; 964 tex->references--;
967 if (tex->references != 0) return; 965 if (tex->references != 0) return;
966 if (tex->fglyph)
967 {
968 tex->gc->font_glyph_textures = eina_list_remove(tex->gc->font_glyph_textures, tex);
969 tex->fglyph->ext_dat = NULL;
970 tex->fglyph->ext_dat_free = NULL;
971 }
968 if (tex->double_buffer.pt[0]) 972 if (tex->double_buffer.pt[0])
969 { 973 {
970 tex->double_buffer.pt[0]->allocations = eina_list_remove(tex->double_buffer.pt[0]->allocations, tex); 974 tex->double_buffer.pt[0]->allocations = eina_list_remove(tex->double_buffer.pt[0]->allocations, tex);