rendercheck: 2 commits - t_gradient.c
Dave Airlie
airlied at kemper.freedesktop.org
Wed Jun 3 19:25:06 PDT 2015
t_gradient.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
New commits:
commit 0f00d5ac7cb0052dbe6357023154fc97759a58f1
Author: Dave Airlie <airlied at redhat.com>
Date: Thu Jun 4 12:23:55 2015 +1000
rendercheck: constrain accuracy
This fixes a bunch of Dst operator, when the dst color
is r5g5b5.
Signed-off-by: Dave Airlie <airlied at redhat.com>
diff --git a/t_gradient.c b/t_gradient.c
index 1096f9a..32df8c4 100644
--- a/t_gradient.c
+++ b/t_gradient.c
@@ -293,7 +293,7 @@ Bool linear_gradient_test(Display *dpy, picture_info *win,
pix = test_pixels;
while (pix->x >= 0) {
-
+ XRenderDirectFormat acc;
get_pixel(dpy, dst, pix->x, pix->y, &tested);
calculate_linear_gradient_color(pix->x, pix->y, &linear_gradient_points[p],
@@ -305,7 +305,9 @@ Bool linear_gradient_test(Display *dpy, picture_info *win,
&expected, False);
color_correct(dst, &expected);
- if (eval_diff(&dst->format->direct, &expected, &tested) > 3.) {
+ accuracy(&acc, &dst->format->direct, &dst_color->format->direct);
+
+ if (eval_diff(&acc, &expected, &tested) > 3.) {
snprintf(testname, 40,
"%s linear gradient", ops[op].name);
print_fail(testname, &expected, &tested, 0, 0,
commit 51fed2fd1252eb8165489e918a478083b32ce4bf
Author: Dave Airlie <airlied at redhat.com>
Date: Thu Jun 4 12:21:57 2015 +1000
rendercheck: make gradient results align with pixman
This makes rendercheck at least useful for regression testing,
18731 tests passed of 51681 total
to
49373 tests passed of 51681 total
Signed-off-by: Dave Airlie <airlied at redhat.com>
diff --git a/t_gradient.c b/t_gradient.c
index 4f84403..1096f9a 100644
--- a/t_gradient.c
+++ b/t_gradient.c
@@ -162,7 +162,7 @@ render_to_gradient_test(Display *dpy, picture_info *src)
static void gradientPixel(const stop *stops, double pos, unsigned int spread, color4d *result)
{
const int PRECISION = 1<<16;
- int ipos = pos * PRECISION - 1;
+ int ipos = (pos + 0.05) * PRECISION - 1;
int i;
double frac;
More information about the xorg-commit
mailing list