From: Joogab Yun Date: Wed, 14 Dec 2016 04:05:14 +0000 (+0900) Subject: [evas_gl] fixed issue about src, dst value when using tbm_surface X-Git-Tag: accepted/tizen/common/20170102.152350~83 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe94c7b9040bc0acc3595cb5c82aa4ab07012063;p=platform%2Fupstream%2Fefl.git [evas_gl] fixed issue about src, dst value when using tbm_surface and need mm_evas_render patch also Change-Id: Ie8fe1f9d33305a9114b44854614e4e14489a4ed4 --- diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index d252ba4..776a7d9 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -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 &&