summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2014-08-05 16:35:41 +0900
committerDaniel Kolesa <d.kolesa@samsung.com>2014-08-08 10:28:51 +0100
commit04074b27ce5d1bc8e916f4e35d6f04708771659e (patch)
tree7d238ada8ec3d3ec5c11d9e0e23a4b2934c8d7f2
parentc15d8800fdfc81e95b7d14d90922bc31479588b2 (diff)
downloadefl-04074b27ce5d1bc8e916f4e35d6f04708771659e.tar.gz
evas/map: correct the interpolation in the span calculation.
As far as i tested, this quality will be better in map transformation, especially in case of the object rotation on z-axis.
-rw-r--r--src/lib/evas/common/evas_map_image.c40
1 files changed, 4 insertions, 36 deletions
diff --git a/src/lib/evas/common/evas_map_image.c b/src/lib/evas/common/evas_map_image.c
index 5001db49be..e6f1cbe949 100644
--- a/src/lib/evas/common/evas_map_image.c
+++ b/src/lib/evas/common/evas_map_image.c
@@ -86,10 +86,10 @@ _interpolated_clip_span(Span *s, int c1, int c2, Eina_Bool interp_col)
static void
_calc_spans(RGBA_Map_Point *p, Line *spans, int ystart, int yend, int cx, int cy EINA_UNUSED, int cw, int ch EINA_UNUSED)
{
- int i, y, yp, yy;
+ int i, y, yp;
int py[4];
int edge[4][4], edge_num, order[4];
- FPc uv[4][2], u, v, x, t, uu, vv, edge_h;
+ FPc uv[4][2], u, v, x, t, edge_h;
DATA32 col[4];
Eina_Bool interp_col = EINA_FALSE;
Eina_Bool swapped;
@@ -227,43 +227,11 @@ _calc_spans(RGBA_Map_Point *p, Line *spans, int ystart, int yend, int cx, int cy
*/
//compute texture u coordinate
u = p[e2].u - p[e1].u;
- uu = u >> FP;
- if (uu < 0) uu = -uu;
- if (uu == edge_h)
- {
- yy = ((y << FP) - p[e1].y) >> FP;
- if (u > 0)
- u = p[e1].u + (yy << FP);
- else
- u = p[e1].u - (yy << FP) - (FP1 - 1);
- }
- else
- {
- if (u >= 0)
- u = p[e1].u + ((u * t) / edge_h);
- else
- u = p[e1].u + (((u * t) - (FP1 / 2)) / edge_h);
- }
+ u = p[e1].u + ((u * t) / edge_h);
//compute texture v coordinate
v = p[e2].v - p[e1].v;
- vv = v >> FP;
- if (vv < 0) vv = -vv;
- if (vv == edge_h)
- {
- yy = ((y << FP) - p[e1].y) >> FP;
- if (v > 0)
- v = p[e1].v + (yy << FP);
- else
- v = p[e1].v - (yy << FP) - (FP1 - 1);
- }
- else
- {
- if (v >= 0)
- v = p[e1].v + ((v * t) / edge_h);
- else
- v = p[e1].v + (((v * t) - (FP1 / 2)) / edge_h);
- }
+ v = p[e1].v + ((v * t) / edge_h);
// FIXME: 3d accuracy for color too
t256 = (t << 8) / edge_h; // maybe * 255?