rendercheck: t_triangles.c

Aaron Plattner aplattner at kemper.freedesktop.org
Tue May 7 08:56:11 PDT 2013


 t_triangles.c |   36 ++++++++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 6 deletions(-)

New commits:
commit b015a64ba19fb832af22e79f54b492ae85f6590e
Author: Vikram Fugro <vfugro at nvidia.com>
Date:   Tue Apr 30 18:38:16 2013 +0530

    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 <vfugro at nvidia.com>
    Reviewed-by: Søren Sandmann <ssp at redhat.com>
    Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
    Tested-by: Aaron Plattner <aplattner at nvidia.com>

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,


More information about the xorg-commit mailing list