Hi all, With the recent pixman library, trapezoid drawing on background has been fixed by clearing the background (instead of retaining the color of the background).
I have done the necessary changes in the triangles use case (in rendercheck) for the "color expected" from the background. Attaching the patch and the snapshots for reference. Thanks, Vikram
From deef33bdc0a1a18b5e4f0ed95ae10c17398e714c Mon Sep 17 00:00:00 2001 From: Vikram Fugro <[email protected]> Date: Tue, 30 Apr 2013 18:38:16 +0530 Subject: [PATCH] t_triangles: Fix for triangles(trapezoids) test case Since pixman v28, the Src and other operators (in, Out, Clear) clear the background when drawing trapezoids, fixing the trapezoid drawing for such operators. Making the necessary change in rendercheck for the color "expected" in the background. Signed-off-by: Vikram Fugro <[email protected]> --- t_triangles.c | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/t_triangles.c b/t_triangles.c index 207b7b0..960d21a 100644 --- a/t_triangles.c +++ b/t_triangles.c @@ -32,6 +32,30 @@ #define TEST_WIDTH 10 #define TEST_HEIGHT 10 + +static void +get_dest_color (int op, color4d *in, color4d *out) +{ + switch (op) { + case PictOpSrc: + case PictOpClear: + case PictOpIn: + case PictOpInReverse: + case PictOpOut: + case PictOpAtopReverse: + out->r = 0.0; + out->g = 0.0; + out->b = 0.0; + out->a = 0.0; + break; + + default: + *out = *in; + break; + } +} + + /* Test basic functionality of the triangle operations. We don't care that much * probably (nobody has used them yet), but we can trivially test by filling * doing two triangles that will exactly cover the rectangle from 2,2 to 4,4. @@ -70,11 +94,11 @@ triangles_test(Display *dpy, picture_info *win, picture_info *dst, int op, copy_pict_to_win(dpy, dst, win, TEST_WIDTH, TEST_HEIGHT); /* Color expected outside of the triangles */ - tdst = dst_color->color; + get_dest_color(ops[op].op, &dst_color->color, &tdst); color_correct(dst, &tdst); /* Color expected inside of the triangles */ - do_composite(ops[op].op, &src_color->color, NULL, &tdst, &tsrc, FALSE); + do_composite(ops[op].op, &src_color->color, NULL, &dst_color->color, &tsrc, FALSE); color_correct(dst, &tsrc); image = XGetImage(dpy, dst->d, @@ -142,11 +166,11 @@ trifan_test(Display *dpy, picture_info *win, picture_info *dst, int op, copy_pict_to_win(dpy, dst, win, TEST_WIDTH, TEST_HEIGHT); /* Color expected outside of the triangles */ - tdst = dst_color->color; + get_dest_color(ops[op].op, &dst_color->color, &tdst); color_correct(dst, &tdst); /* Color expected inside of the triangles */ - do_composite(ops[op].op, &src_color->color, NULL, &tdst, &tsrc, FALSE); + do_composite(ops[op].op, &src_color->color, NULL, &dst_color->color, &tsrc, FALSE); color_correct(dst, &tsrc); image = XGetImage(dpy, dst->d, @@ -214,11 +238,11 @@ tristrip_test(Display *dpy, picture_info *win, picture_info *dst, int op, copy_pict_to_win(dpy, dst, win, TEST_WIDTH, TEST_HEIGHT); /* Color expected outside of the triangles */ - tdst = dst_color->color; + get_dest_color(ops[op].op, &dst_color->color, &tdst); color_correct(dst, &tdst); /* Color expected inside of the triangles */ - do_composite(ops[op].op, &src_color->color, NULL, &tdst, &tsrc, FALSE); + do_composite(ops[op].op, &src_color->color, NULL, &dst_color->color, &tsrc, FALSE); color_correct(dst, &tsrc); image = XGetImage(dpy, dst->d, -- 1.7.9.5
<<attachment: wrong_old_pixman26.jpg>>
<<attachment: correct_new_pixman28.jpg>>
_______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
