fix font alloc bug!

SVN revision: 43686
This commit is contained in:
Carsten Haitzler 2009-11-14 05:08:00 +00:00
parent 52468a9940
commit 16764f7d61
2 changed files with 16 additions and 13 deletions

View File

@ -301,7 +301,9 @@ evas_gl_common_image_map4_draw(Evas_GL_Context *gc, Evas_GL_Image *im,
} }
_evas_gl_common_image_update(gc, im); _evas_gl_common_image_update(gc, im);
// FIXME: need to handle clipping with a scissor. only sane way to do it.
glFlush(); glFlush();
c = gc->dc->clip.use; c = gc->dc->clip.use;

View File

@ -384,14 +384,10 @@ pt_unref(Evas_GL_Texture_Pool *pt)
pt->references--; pt->references--;
if (pt->references > 0) return; if (pt->references > 0) return;
if (pt->whole) if (pt->whole)
{ pt->gc->shared->tex.whole = eina_list_remove(pt->gc->shared->tex.whole, pt);
pt->gc->shared->tex.whole = eina_list_remove(pt->gc->shared->tex.whole, pt);
}
else else
{ pt->gc->shared->tex.atlas [pt->slot][pt->fslot] =
pt->gc->shared->tex.atlas [pt->slot][pt->fslot] = eina_list_remove(pt->gc->shared->tex.atlas[pt->slot][pt->fslot], pt);
eina_list_remove(pt->gc->shared->tex.atlas[pt->slot][pt->fslot], pt);
}
glDeleteTextures(1, &(pt->texture)); glDeleteTextures(1, &(pt->texture));
if (pt->fb) glDeleteFramebuffers(1, &(pt->fb)); if (pt->fb) glDeleteFramebuffers(1, &(pt->fb));
free(pt); free(pt);
@ -411,7 +407,8 @@ evas_gl_common_texture_free(Evas_GL_Texture *tex)
} }
Evas_GL_Texture * Evas_GL_Texture *
evas_gl_common_texture_alpha_new(Evas_GL_Context *gc, DATA8 *pixels, int w, int h, int fh) evas_gl_common_texture_alpha_new(Evas_GL_Context *gc, DATA8 *pixels,
int w, int h, int fh)
{ {
Evas_GL_Texture *tex; Evas_GL_Texture *tex;
Eina_List *l_after = NULL; Eina_List *l_after = NULL;
@ -425,7 +422,8 @@ evas_gl_common_texture_alpha_new(Evas_GL_Context *gc, DATA8 *pixels, int w, int
tex->references = 1; tex->references = 1;
if (tw > gc->shared->info.max_texture_size) if (tw > gc->shared->info.max_texture_size)
tw = gc->shared->info.max_texture_size; tw = gc->shared->info.max_texture_size;
tex->pt = _pool_tex_find(gc, w + 3, fh, alpha_ifmt, alpha_fmt, &u, &v, &l_after, tw); tex->pt = _pool_tex_find(gc, w + 3, fh, alpha_ifmt, alpha_fmt, &u, &v,
&l_after, tw);
if (!tex->pt) if (!tex->pt)
{ {
free(tex); free(tex);
@ -436,7 +434,8 @@ evas_gl_common_texture_alpha_new(Evas_GL_Context *gc, DATA8 *pixels, int w, int
tex->w = w; tex->w = w;
tex->h = h; tex->h = h;
if (l_after) if (l_after)
tex->pt->allocations = eina_list_append_relative(tex->pt->allocations, tex, l_after); tex->pt->allocations =
eina_list_append_relative_list(tex->pt->allocations, tex, l_after);
else else
tex->pt->allocations = eina_list_prepend(tex->pt->allocations, tex); tex->pt->allocations = eina_list_prepend(tex->pt->allocations, tex);
tex->pt->references++; tex->pt->references++;
@ -445,14 +444,16 @@ evas_gl_common_texture_alpha_new(Evas_GL_Context *gc, DATA8 *pixels, int w, int
} }
void void
evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels, int w, int h, int fh) evas_gl_common_texture_alpha_update(Evas_GL_Texture *tex, DATA8 *pixels,
int w, int h, int fh)
{ {
glBindTexture(GL_TEXTURE_2D, tex->pt->texture); glBindTexture(GL_TEXTURE_2D, tex->pt->texture);
#ifdef GL_UNPACK_ROW_LENGTH #ifdef GL_UNPACK_ROW_LENGTH
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
#endif #endif
glPixelStorei(GL_UNPACK_ALIGNMENT, 4); glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
_tex_sub_2d(tex->x, tex->y, w, h, tex->pt->format, tex->pt->dataformat, pixels); _tex_sub_2d(tex->x, tex->y, w, h, tex->pt->format, tex->pt->dataformat,
pixels);
if (tex->pt->texture != tex->gc->shader.cur_tex) if (tex->pt->texture != tex->gc->shader.cur_tex)
glBindTexture(GL_TEXTURE_2D, tex->gc->shader.cur_tex); glBindTexture(GL_TEXTURE_2D, tex->gc->shader.cur_tex);
} }