[evas_gl] fixed issue about src, dst value when using tbm_surface
authorJoogab Yun <joogab.yun@samsung.com>
Wed, 14 Dec 2016 04:05:14 +0000 (13:05 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Mon, 2 Jan 2017 07:25:24 +0000 (16:25 +0900)
          and need mm_evas_render patch also

Change-Id: Ie8fe1f9d33305a9114b44854614e4e14489a4ed4

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

index d252ba4..776a7d9 100644 (file)
@@ -2245,25 +2245,11 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
          dst_ratio = (double) sw / sh;
          if (tex->im->native.rot == EVAS_IMAGE_ORIENT_90)
             {
-               if (src_ratio > dst_ratio)
-                  {
-                     sy = (tex->im->h - sy - sh)  * sh / (double)sw;
-                     if (1 > dst_ratio)
-                        sx = sy * sh / (double)sw;
-                     SWAP(&sw, &sh, tmp);
-                  }
-               else if (src_ratio < dst_ratio)
-                  {
-                     tmp_ori_ratio_h = sh * tex->im->w / (double)tex->im->h;
-                     tmp_small_ratio_h = sh * tex->im->h / (double)tex->im->w;
-                     sx = sx * (tmp_ori_ratio_h / tmp_small_ratio_h);
-
-                     tmp = sx; sx = (tex->im->h - sy - sh) * tex->im->w / (double)tex->im->h;
-                     sy = tmp * tex->im->h / (double)tex->im->w;
-
-                     tmp = sw; sw = sh * tex->im->h / (double)tex->im->w;
-                     sh = tmp * tex->im->h / (double)tex->im->w;
-                  }
+               tmp = sx; sx = (tex->im->h - sy - sh) * tex->im->w / (double)tex->im->h;
+               sy = tmp * tex->im->h / (double)tex->im->w;
+
+               tmp = sw; sw = sh * tex->im->w / (double)tex->im->h;
+               sh = tmp * tex->im->h / (double)tex->im->w;
             }
 
          // both HORIZONTAL and VERTICAL flip
@@ -2276,26 +2262,11 @@ evas_gl_common_context_image_push(Evas_Engine_GL_Context *gc,
 
          if (tex->im->native.rot == EVAS_IMAGE_ORIENT_270)
             {
-               if (src_ratio > dst_ratio)
-                  {
-                     sx = (tex->im->w - sx - sw) * sw / (double)sh;
-                     if (1 > dst_ratio)
-                        sy = sx * sw / (double)sh;
-                     SWAP(&sw, &sh, tmp);
-
-                  }
-               else if (src_ratio < dst_ratio)
-                  {
-                     tmp_ori_ratio_h = sh * tex->im->w / (double)tex->im->h;
-                     tmp_small_ratio_h = sh * tex->im->h / (double)tex->im->w;
-                     sy = sy * (tmp_ori_ratio_h / tmp_small_ratio_h);
-
-                     tmp = sy; sy = (tex->im->w - sx - sw) * tex->im->h / (double)tex->im->w;
-                     sx = tmp * tex->im->w / (double)tex->im->h;
-
-                     tmp = sw; sw = sh * tex->im->h / (double)tex->im->w;
-                     sh = tmp * tex->im->h / (double)tex->im->w;
-                  }
+               tmp = sy; sy = (tex->im->w - sx - sw) * tex->im->h / (double)tex->im->w;
+               sx = tmp * tex->im->w / (double)tex->im->h;
+
+               tmp = sw; sw = sh * tex->im->w / (double)tex->im->h;
+               sh = tmp * tex->im->h / (double)tex->im->w;
             }
 
          if (tex->im &&