evas: fix usage of the same ressource in the GL backend with orient.
authorCedric BAIL <cedric@osg.samsung.com>
Fri, 24 Apr 2015 15:04:58 +0000 (17:04 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Sat, 25 Apr 2015 08:15:13 +0000 (10:15 +0200)
When we set orient we actually need to return a new image or it will confuse
evas a lot.

src/modules/evas/engines/gl_generic/evas_engine.c

index 6ef0d505974d872faf2d411c6a103a87af86709a..952dee20c6a60f9b23bac08cf9a1725ca51425f6 100644 (file)
@@ -899,6 +899,7 @@ eng_image_orient_set(void *data, void *image, Evas_Image_Orient orient)
 {
    Render_Engine_GL_Generic *re = data;
    Evas_GL_Image *im;
+   Evas_GL_Image *im_new;
 
    if (!image) return NULL;
    im = image;
@@ -906,8 +907,19 @@ eng_image_orient_set(void *data, void *image, Evas_Image_Orient orient)
 
    re->window_use(re->software.ob);
 
-   im->orient = orient;
-   return im;
+   evas_gl_common_image_update(im->gc, im);
+
+   im_new = evas_gl_common_image_new(im->gc, im->w, im->h, im->alpha, im->cs.space);
+   if (!im_new) return im;
+
+   *im_new = *im;
+
+   im_new->tex->references++;
+   im_new->tex->pt->references++;
+   im_new->orient = orient;
+
+   evas_gl_common_image_free(im);
+   return im_new;
 }
 
 static Evas_Image_Orient