From: raster Date: Fri, 11 Nov 2011 07:47:25 +0000 (+0000) Subject: ooh aznd other part of dyn img patch goes in. X-Git-Tag: 2.0_alpha~170^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b91a43eb7b7486d0754d7bb82a5a1ce2b6ce7bfd;p=framework%2Fuifw%2Fevas.git ooh aznd other part of dyn img patch goes in. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@65053 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/modules/engines/gl_x11/evas_engine.c b/src/modules/engines/gl_x11/evas_engine.c index 52e1ebd..fe2eba3 100644 --- a/src/modules/engines/gl_x11/evas_engine.c +++ b/src/modules/engines/gl_x11/evas_engine.c @@ -2404,14 +2404,21 @@ eng_image_data_get(void *data, void *image, int to_write, DATA32 **image_data, i if ((im->tex) && (im->tex->pt) && (im->tex->pt->dyn.img) && (im->cs.space == EVAS_COLORSPACE_ARGB8888)) { + if (im->tex->pt->dyn.checked_out > 0) + { + im->tex->pt->dyn.checked_out++; + *image_data = im->tex->pt->dyn.data; + if (err) *err = EVAS_LOAD_ERROR_NONE; + return im; + } *image_data = im->tex->pt->dyn.data = glsym_eglMapImageSEC(re->win->egl_disp, im->tex->pt->dyn.img); if (!im->tex->pt->dyn.data) { - glsym_eglDestroyImage(re->win->egl_disp, im->tex->pt->dyn.img); im->tex->pt->dyn.img = NULL; GLERR(__FUNCTION__, __FILE__, __LINE__, ""); } + im->tex->pt->dyn.checked_out++; if (err) *err = EVAS_LOAD_ERROR_NONE; return im; @@ -2498,11 +2505,15 @@ eng_image_data_put(void *data, void *image, DATA32 *image_data) { int w, h; + if (im->tex->pt->dyn.data == image_data) + { + im->tex->pt->dyn.checked_out--; #if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX) - glsym_eglUnmapImageSEC(re->win->egl_disp, im->tex->pt->dyn.img); + if (im->tex->pt->dyn.checked_out == 0) + glsym_eglUnmapImageSEC(re->win->egl_disp, im->tex->pt->dyn.img); #endif - if (im->tex->pt->dyn.data == image_data) - return image; + return image; + } w = im->im->cache_entry.w; h = im->im->cache_entry.h;