The left and right pixel duplication for interpolation had the WRONG PIXELS
authorSeungsoo Woo <om101.woo@samsung.com>
Thu, 27 Oct 2011 03:51:57 +0000 (12:51 +0900)
committerSeungsoo Woo <om101.woo@samsung.com>
Thu, 27 Oct 2011 03:51:57 +0000 (12:51 +0900)
Change-Id: Idec36f6a6b6c81dd912d1a327285ca6e24d965a9

src/modules/engines/gl_common/evas_gl_texture.c

index 0c12d7d..3420444 100644 (file)
@@ -846,7 +846,6 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
    glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
    GLERR(__FUNCTION__, __FILE__, __LINE__, "");
 
-//   printf("tex upload %ix%i\n", im->cache_entry.w, im->cache_entry.h);
    //  +-+
    //  +-+
    //
@@ -854,6 +853,9 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
                im->cache_entry.w, im->cache_entry.h,
                fmt, tex->pt->dataformat,
                im->image.data);
+#ifdef GL_UNPACK_ROW_LENGTH
+   glPixelStorei(GL_UNPACK_ROW_LENGTH, im->cache_entry.w);
+   GLERR(__FUNCTION__, __FILE__, __LINE__, "");
    // |xxx
    // |xxx
    //
@@ -868,6 +870,44 @@ evas_gl_common_texture_update(Evas_GL_Texture *tex, RGBA_Image *im)
                1, im->cache_entry.h,
                fmt, tex->pt->dataformat,
                im->image.data + (im->cache_entry.w - 1));
+#else
+   {
+      DATA32 *tpix, *ps, *pd;
+      int i;
+
+      tpix = alloca(im->cache_entry.h * sizeof(DATA32));
+      pd = tpix;
+      ps = im->image.data;
+      for (i = 0; i < im->cache_entry.h; i++)
+        {
+           *pd = *ps;
+           pd++;
+           ps += im->cache_entry.w;
+        }
+      // |xxx
+      // |xxx
+      //
+      _tex_sub_2d(tex->x - 1, tex->y,
+                  1, im->cache_entry.h,
+                  fmt, tex->pt->dataformat,
+                  tpix);
+      pd = tpix;
+      ps = im->image.data + (im->cache_entry.w - 1);
+      for (i = 0; i < im->cache_entry.h; i++)
+        {
+           *pd = *ps;
+           pd++;
+           ps += im->cache_entry.w;
+        }
+      //  xxx|
+      //  xxx|
+      //
+      _tex_sub_2d(tex->x + im->cache_entry.w, tex->y,
+                  1, im->cache_entry.h,
+                  fmt, tex->pt->dataformat,
+                  tpix);
+   }
+#endif
    //  xxx
    //  xxx
    //  ---