summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVikram Fugro <vfugro@nvidia.com>2013-04-30 18:38:16 +0530
committerAaron Plattner <aplattner@nvidia.com>2013-05-07 08:55:11 -0700
commitb015a64ba19fb832af22e79f54b492ae85f6590e (patch)
tree1b582f1b77d9cc28457db55781db3732cc0a5b85
parent313a9689db26a2a7c384836b7838cb1d2261f228 (diff)
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@nvidia.com> Reviewed-by: Søren Sandmann <ssp@redhat.com> Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Tested-by: Aaron Plattner <aplattner@nvidia.com>
-rw-r--r--t_triangles.c36
1 files 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,