From: raster Date: Sat, 10 Oct 2009 14:55:10 +0000 (+0000) Subject: and delete u and v textures too X-Git-Tag: accepted/2.0/20130306.225542~242^2~2282 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51c8fa0be48a17d56336ee2109bf4fe92ff8bb71;p=profile%2Fivi%2Fevas.git and delete u and v textures too git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@43002 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/modules/engines/gl_common/evas_gl_texture.c b/src/modules/engines/gl_common/evas_gl_texture.c index 3b80cc0..dab86d2 100644 --- a/src/modules/engines/gl_common/evas_gl_texture.c +++ b/src/modules/engines/gl_common/evas_gl_texture.c @@ -273,6 +273,24 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im) } } +static void +pt_unref(Evas_GL_Texture_Pool *pt) +{ + pt->references--; + if (pt->references > 0) return; + if (pt->whole) + { + pt->gc->tex.whole = eina_list_remove(pt->gc->tex.whole, pt); + } + else + { + pt->gc->tex.atlas [pt->slot][pt->fslot] = + eina_list_remove(pt->gc->tex.atlas[pt->slot][pt->fslot], pt); + } + glDeleteTextures(1, &(pt->texture)); + free(pt); +} + void evas_gl_common_texture_free(Evas_GL_Texture *tex) { @@ -280,26 +298,9 @@ evas_gl_common_texture_free(Evas_GL_Texture *tex) tex->references--; if (tex->references > 0) return; tex->pt->allocations = eina_list_remove(tex->pt->allocations, tex); - tex->pt->references--; - if (tex->pt->references <= 0) - { - if (tex->pt->whole) - { - tex->gc->tex.whole = - eina_list_remove(tex->gc->tex.whole, tex->pt); - } - else - { - tex->gc->tex.atlas - [tex->pt->slot][tex->pt->fslot] = - eina_list_remove - (tex->gc->tex.atlas - [tex->pt->slot][tex->pt->fslot], - tex->pt); - } - glDeleteTextures(1, &(tex->pt->texture)); - free(tex->pt); - } + pt_unref(tex->pt); + if (tex->ptu) pt_unref(tex->ptu); + if (tex->ptv) pt_unref(tex->ptv); free(tex); }