evas/map: correct last 1 pixel handling in spans.
authorChunEon Park <hermet@hermet.pe.kr>
Wed, 26 Nov 2014 08:39:27 +0000 (17:39 +0900)
committerChunEon Park <hermet@hermet.pe.kr>
Wed, 26 Nov 2014 08:39:27 +0000 (17:39 +0900)
Clipper causes the different rendering result by last 1 pixel on the width.
Because the left edge x range (0 ~ (w - 1)) and right edge x range (0  ~ w) is different.
This fix won't be memory over access problem even if x span position is on the end of the edge.
Because the span width(x2 - x1) will be 0, and it restuls in skipping drawing.
It's hardly find the problem but you can detect the subtle rendering difference when some arbitrary meshes with map is
You can compare image and rectangle map drawing for this.

@fix

src/lib/evas/common/evas_map_image.c

index 8cc83d9..69e7f5f 100644 (file)
@@ -285,7 +285,7 @@ _calc_spans(RGBA_Map_Point *p, Line *spans, int ystart, int yend, int cx, int cy
              spans[yp].span[i].col[1] = col[order[1]];
 
              //Outside of the clipper
-             if ((spans[yp].span[i].x[0] >= (cx + cw)) ||
+             if ((spans[yp].span[i].x[0] > (cx + cw)) ||
                  (spans[yp].span[i].x[1] < cx))
                spans[yp].span[i].x[0] = -1;
              else
@@ -310,7 +310,7 @@ _calc_spans(RGBA_Map_Point *p, Line *spans, int ystart, int yend, int cx, int cy
              spans[yp].span[i].col[1] = col[order[1]];
 
              //Outside of the clipper
-             if ((spans[yp].span[i].x[0] >= (cx + cw)) ||
+             if ((spans[yp].span[i].x[0] > (cx + cw)) ||
                  (spans[yp].span[i].x[1] < cx))
                spans[yp].span[i].x[0] = -1;
              else
@@ -331,7 +331,7 @@ _calc_spans(RGBA_Map_Point *p, Line *spans, int ystart, int yend, int cx, int cy
              spans[yp].span[i].col[1] = col[order[3]];
 
              //Outside of the clipper
-             if ((spans[yp].span[i].x[0] >= (cx + cw)) ||
+             if ((spans[yp].span[i].x[0] > (cx + cw)) ||
                  (spans[yp].span[i].x[1] < cx))
                spans[yp].span[i].x[0] = -1;
              else