[evas_gl] calculates texture sampling for orient (90 or 270)
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 18 Jul 2017 00:53:14 +0000 (09:53 +0900)
committerJiyoun Park <jy0703.park@samsung.com>
Thu, 21 Dec 2017 07:26:57 +0000 (16:26 +0900)
Change-Id: I9744ab3379c64fc3c829885a17295b22f2b210a2

src/modules/evas/engines/gl_common/evas_gl_context.c

index 9ea7fab..76f1cd4 100755 (executable)
@@ -2440,8 +2440,19 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
 
    if (sam)
      {
-        double samx = (double)(sw) / (double)(tex->pt->w * w * 4);
-        double samy = (double)(sh) / (double)(tex->pt->h * h * 4);
+       double samx;
+       double samy;
+       if (tex->im &&
+           (tex->im->orient == EVAS_IMAGE_ORIENT_270 || tex->im->orient == EVAS_IMAGE_ORIENT_90))
+         {
+           samx = (double)(sh) / (double)(tex->pt->h * w * 4);
+           samy = (double)(sw) / (double)(tex->pt->w * h * 4);
+         }
+       else
+         {
+           samx = (double)(sw) / (double)(tex->pt->w * w * 4);
+           samy = (double)(sh) / (double)(tex->pt->h * h * 4);
+         }
         PUSH_SAMPLES(pn, samx, samy);
      }