[evas_gl] prevent a texture from become null when using dynamic hint 15/90215/2
authorJoogab Yun <joogab.yun@samsung.com>
Thu, 29 Sep 2016 04:29:28 +0000 (13:29 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 29 Sep 2016 05:11:25 +0000 (22:11 -0700)
set.
          and add debug log

Change-Id: Iea04129650c14a853b487bdebfe804c788311d66

src/modules/evas/engines/gl_common/evas_gl_image.c [changed mode: 0755->0644]
src/modules/evas/engines/gl_common/evas_gl_texture.c [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 0e62270..e3499ed
@@ -622,6 +622,8 @@ evas_gl_common_image_content_hint_set(Evas_GL_Image *im, int hint)
      {
         if ((!im->gc->shared->info.sec_image_map) &&
             ((!im->gc->shared->info.sec_tbm_surface) || (!im->gc->shared->info.egl_tbm_ext))) return;
+        Evas_GL_Texture *tex = evas_gl_common_texture_dynamic_new(im->gc, im);
+        if (!tex) return;
         if (im->cs.data)
           {
              if (!im->cs.no_free) free(im->cs.data);
@@ -650,7 +652,7 @@ evas_gl_common_image_content_hint_set(Evas_GL_Image *im, int hint)
              evas_gl_common_texture_free(im->tex, EINA_TRUE);
              im->tex = NULL;
           }
-        im->tex = evas_gl_common_texture_dynamic_new(im->gc, im);
+        im->tex = tex;
         im->tex_only = 1;
      }
    else
old mode 100755 (executable)
new mode 100644 (file)
index 3746ba9..83813c8
@@ -811,6 +811,7 @@ _pool_tex_dynamic_new(Evas_Engine_GL_Context *gc, int w, int h, int intformat, i
                                             pt->dyn.buffer, NULL);
         if (!pt->dyn.img)
           {
+             ERR("eglCreateImage() failed");
              secsym_tbm_surface_destroy(pt->dyn.buffer);
              goto error;
           }