evas: fix size of borders in case need generate texture without atlases
authorOleksandr Shcherbina <o.shcherbina@samsung.com>
Tue, 28 Jul 2015 20:33:49 +0000 (22:33 +0200)
committerCedric BAIL <cedric@osg.samsung.com>
Tue, 28 Jul 2015 20:33:52 +0000 (22:33 +0200)
Summary:
Set size of texture unit without 2 pixels for borders in case use it without
atlses. Just one case if texture for 3D use repeat mode and non-normalized
tuxture coordinates

Reviewers: Hermet, cedric

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D2805

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/modules/evas/engines/gl_common/evas_gl_texture.c

index b54f650..f6d41da 100644 (file)
@@ -526,9 +526,20 @@ evas_gl_common_texture_new(Evas_Engine_GL_Context *gc, RGBA_Image *im, Eina_Bool
       case EVAS_COLORSPACE_ETC1_ALPHA:
         return evas_gl_common_texture_rgb_a_pair_new(gc, im);
      default:
-        // One pixel gap and two pixels for duplicated borders
-        w = im->cache_entry.w + 3;
-        h = im->cache_entry.h + 3;
+        if (disable_atlas)
+          {
+             /*Just one pixel gap. Generate texture unit without pixels for
+             borders in case using this for evas_canvas3d in repeat mode of the
+             texture unit*/
+             w = im->cache_entry.w + 1;
+             h = im->cache_entry.h + 1;
+          }
+        else
+          {
+             /*One pixel gap and two pixels for duplicated borders*/
+             w = im->cache_entry.w + 3;
+             h = im->cache_entry.h + 3;
+          }
         break;
      }