summaryrefslogtreecommitdiff
path: root/src/lib/evas/common
diff options
context:
space:
mode:
authorHermet Park <hermet@hermet.pe.kr>2016-09-12 16:50:00 +0900
committerHermet Park <hermet@hermet.pe.kr>2016-09-12 16:50:00 +0900
commite8fcc41e40dee07d062bff51636e464ff9d98215 (patch)
treef574cb4a828c6e96b96d53c86a1ad6e9e964f3d7 /src/lib/evas/common
parentffe53365065d043e4ddf302fcbc02c988fac3430 (diff)
evas map: fix the rendering problem.
I got an issue report about map rendering. After investigated, I found that was introduced by data overflow. For fast computation, evas map uses integer data type rather than float, that gives up some range of data size. So, if vertex range is a little large but still reasonable, polygon won'be properly displayed due to the integer overflow. We can fix this by changing FPc data type to 64 bits (ie, long long) But I didn't do yet though I can simply fix this costlessly. By the way, my test case map points are below. 0: -1715, -5499 1: -83, -1011 2: 1957, 5721 3: 325, 1233 and gl result is perfect but sw is totally broken. @fix
Diffstat (limited to 'src/lib/evas/common')
-rw-r--r--src/lib/evas/common/evas_map_image.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/lib/evas/common/evas_map_image.c b/src/lib/evas/common/evas_map_image.c
index 252bd3ba58..2a48b20d35 100644
--- a/src/lib/evas/common/evas_map_image.c
+++ b/src/lib/evas/common/evas_map_image.c
@@ -183,8 +183,15 @@ _calc_spans(RGBA_Map_Point *p, Line *spans, int ystart, int yend, int cx, int cy
183 edge_h = (p[e2].y - p[e1].y) >> FP; //edge height 183 edge_h = (p[e2].y - p[e1].y) >> FP; //edge height
184 if (edge_h < 1) edge_h = 1; 184 if (edge_h < 1) edge_h = 1;
185 t = (((y << FP) + (FP1 / 2) - 1) - p[e1].y) >> FP; 185 t = (((y << FP) + (FP1 / 2) - 1) - p[e1].y) >> FP;
186 x= p[e2].x - p[e1].x; //edge width 186 x = p[e2].x - p[e1].x; //edge width
187 x = p[e1].x + ((x * t) / edge_h); // intersected x point 187
188 FPc temp = (x * t);
189
190 // TODO: prevent data overflow. We can remove this exception if FPc type is more than integer.
191 if (temp < 0) temp = (((x >> FP) * t) / edge_h) << FP;
192 else temp /= edge_h;
193
194 x = p[e1].x + temp; // intersected x point
188 195
189/* 196/*
190 // FIXME: 3d accuracy here 197 // FIXME: 3d accuracy here