summaryrefslogtreecommitdiff
path: root/test/simple.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-10-02 00:20:52 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-10-02 08:46:44 +0100
commit79c8b14b9fd8716d47fab4436b34d26b0135e9d7 (patch)
tree70c8d4faad21e6b5a7063972407f2e5ce244b8d4 /test/simple.c
parent50b41e214533ea5fd3b64128306b6cb94d353145 (diff)
downloadcairo-79c8b14b9fd8716d47fab4436b34d26b0135e9d7.tar.gz
test/simple: Tighten sanity checks in reference image generator
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'test/simple.c')
-rw-r--r--test/simple.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/simple.c b/test/simple.c
index 674a0de3d..7ec8a9ac5 100644
--- a/test/simple.c
+++ b/test/simple.c
@@ -54,8 +54,6 @@ static int pfrac (int v)
return v & ((1 << CAIRO_FIXED_FRAC_BITS) - 1);
}
-#define BIAS 1024
-
static void add_edge (struct coverage *coverage,
int x1, int y1, int x2, int y2,
int sign)
@@ -98,9 +96,11 @@ static void add_edge (struct coverage *coverage,
int x = xq + (xr >= dy/2);
if (x < 256*coverage->width) {
- int i = pfloor (y) * coverage->width + pfloor (x);
- if (x > 0)
+ int i = pfloor (y) * coverage->width;
+ if (x > 0) {
+ i += pfloor (x);
coverage->cells[i].uncovered_area += sign * pfrac(x);
+ }
coverage->cells[i].covered_height += sign;
}