[evas_gl] calculates texture sampling for orient (90 or 270) 82/139182/2
authorJoogab Yun <joogab.yun@samsung.com>
Tue, 18 Jul 2017 00:53:14 +0000 (09:53 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Wed, 19 Jul 2017 05:57:59 +0000 (05:57 +0000)
Change-Id: I9744ab3379c64fc3c829885a17295b22f2b210a2

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

index 50fd4eb..8647c32 100644 (file)
@@ -2418,8 +2418,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);
      }