diff options
-rw-r--r-- | rendercheck.h | 3 | ||||
-rw-r--r-- | t_blend.c | 13 | ||||
-rw-r--r-- | t_composite.c | 9 | ||||
-rw-r--r-- | t_dstcoords.c | 7 | ||||
-rw-r--r-- | t_fill.c | 2 | ||||
-rw-r--r-- | t_gradient.c | 2 | ||||
-rw-r--r-- | t_repeat.c | 2 | ||||
-rw-r--r-- | t_triangles.c | 15 | ||||
-rw-r--r-- | tests.c | 5 |
9 files changed, 36 insertions, 22 deletions
diff --git a/rendercheck.h b/rendercheck.h index 27a8e5c..f32420e 100644 --- a/rendercheck.h +++ b/rendercheck.h @@ -117,7 +117,8 @@ Bool do_tests(Display *dpy, picture_info *win); void -copy_pict_to_win(Display *dpy, picture_info *pict, picture_info *win); +copy_pict_to_win(Display *dpy, picture_info *pict, picture_info *win, + int width, int height); /* ops.c */ void @@ -24,6 +24,9 @@ #include "rendercheck.h" +#define TEST_WIDTH 10 +#define TEST_HEIGHT 10 + /* Test a composite of a given operation, source, and destination picture. * Fills the window, and samples from the 0,0 pixel corner. */ @@ -36,13 +39,13 @@ blend_test(Display *dpy, picture_info *win, picture_info *dst, int op, int i; for (i = 0; i < pixmap_move_iter; i++) { - XRenderComposite(dpy, PictOpSrc, dst_color->pict, 0, dst->pict, 0, 0, - 0, 0, 0, 0, win_width, win_height); - XRenderComposite(dpy, ops[op].op, src_color->pict, 0, dst->pict, 0, 0, - 0, 0, 0, 0, win_width, win_height); + XRenderComposite(dpy, PictOpSrc, dst_color->pict, 0, + dst->pict, 0, 0, 0, 0, 0, 0, TEST_WIDTH, TEST_HEIGHT); + XRenderComposite(dpy, ops[op].op, src_color->pict, 0, + dst->pict, 0, 0, 0, 0, 0, 0, TEST_WIDTH, TEST_HEIGHT); } get_pixel(dpy, dst, 0, 0, &tested); - copy_pict_to_win(dpy, dst, win); + copy_pict_to_win(dpy, dst, win, TEST_WIDTH, TEST_HEIGHT); tdst = dst_color->color; color_correct(dst, &tdst); diff --git a/t_composite.c b/t_composite.c index fd73eec..25b4dd0 100644 --- a/t_composite.c +++ b/t_composite.c @@ -24,6 +24,9 @@ #include "rendercheck.h" +#define TEST_WIDTH 10 +#define TEST_HEIGHT 10 + /* Test a composite of a given operation, source, mask, and destination picture. * Fills the window, and samples from the 0,0 pixel corner. */ @@ -45,13 +48,13 @@ composite_test(Display *dpy, picture_info *win, picture_info *dst, int op, } for (i = 0; i < pixmap_move_iter; i++) { XRenderComposite(dpy, PictOpSrc, dst_color->pict, 0, dst->pict, - 0, 0, 0, 0, 0, 0, win_width, win_height); + 0, 0, 0, 0, 0, 0, TEST_WIDTH, TEST_HEIGHT); XRenderComposite(dpy, ops[op].op, src_color->pict, mask_color->pict, dst->pict, 0, 0, 0, 0, 0, 0, - win_width, win_height); + TEST_WIDTH, TEST_HEIGHT); } get_pixel(dpy, dst, 0, 0, &tested); - copy_pict_to_win(dpy, dst, win); + copy_pict_to_win(dpy, dst, win, TEST_WIDTH, TEST_HEIGHT); if (componentAlpha) { pa.component_alpha = FALSE; diff --git a/t_dstcoords.c b/t_dstcoords.c index db71e48..e9f14d9 100644 --- a/t_dstcoords.c +++ b/t_dstcoords.c @@ -24,6 +24,9 @@ #include "rendercheck.h" +#define TEST_WIDTH 10 +#define TEST_HEIGHT 10 + /* Test destination coordinates by drawing a 3x3 picture offset one pixel. * XXX: This should be done with another operation, to catch issues with Render * acceleration in the non-CopyArea-equivalent case. @@ -38,12 +41,12 @@ dstcoords_test(Display *dpy, picture_info *win, picture_info *dst, for (i = 0; i < pixmap_move_iter; i++) { XRenderComposite(dpy, PictOpSrc, bg->pict, 0, dst->pict, 0, 0, - 0, 0, 0, 0, win_width, win_height); + 0, 0, 0, 0, TEST_WIDTH, TEST_HEIGHT); XRenderComposite(dpy, PictOpSrc, fg->pict, 0, dst->pict, 0, 0, 0, 0, 1, 1, 1, 1); } - copy_pict_to_win(dpy, dst, win); + copy_pict_to_win(dpy, dst, win, TEST_WIDTH, TEST_HEIGHT); for (x = 0; x < 3; x++) { for (y = 0; y < 3; y++) { @@ -36,7 +36,7 @@ fill_test(Display *dpy, picture_info *win, picture_info *src) get_pixel(dpy, src, 0, 0, &tested); - copy_pict_to_win(dpy, src, win); + copy_pict_to_win(dpy, src, win, win_width, win_height); strcpy(name, "fill "); describe_format(name, 20 - strlen(name), src->format); diff --git a/t_gradient.c b/t_gradient.c index 34aded1..3af209d 100644 --- a/t_gradient.c +++ b/t_gradient.c @@ -216,7 +216,7 @@ Bool linear_gradient_test(Display *dpy, picture_info *win, XRenderComposite(dpy, ops[op].op, gradient, 0, dst->pict, 0, 0, 0, 0, 0, 0, win_width, win_height); - copy_pict_to_win(dpy, dst, win); + copy_pict_to_win(dpy, dst, win, win_width, win_height); pix = test_pixels; while (pix->x >= 0) { @@ -97,7 +97,7 @@ repeat_test(Display *dpy, picture_info *win, picture_info *dst, int op, } } - copy_pict_to_win(dpy, dst, win); + copy_pict_to_win(dpy, dst, win, win_width, win_height); tdst = dst_color->color; color_correct(dst, &tdst); diff --git a/t_triangles.c b/t_triangles.c index e552560..230c2ff 100644 --- a/t_triangles.c +++ b/t_triangles.c @@ -29,6 +29,9 @@ #include "rendercheck.h" +#define TEST_WIDTH 10 +#define TEST_HEIGHT 10 + /* 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. @@ -58,12 +61,12 @@ triangles_test(Display *dpy, picture_info *win, picture_info *dst, int op, /* Fill the dst to dst_color */ XRenderComposite(dpy, PictOpSrc, dst_color->pict, None, dst->pict, 0, 0, - 0, 0, 0, 0, win_width, win_height); + 0, 0, 0, 0, TEST_WIDTH, TEST_HEIGHT); /* Paint the triangles with src_color */ XRenderCompositeTriangles(dpy, ops[op].op, src_color->pict, dst->pict, XRenderFindStandardFormat(dpy, PictStandardA8), 0, 0, triangles, 2); - copy_pict_to_win(dpy, dst, win); + copy_pict_to_win(dpy, dst, win, TEST_WIDTH, TEST_HEIGHT); /* Color expected outside of the triangles */ tdst = dst_color->color; @@ -124,12 +127,12 @@ trifan_test(Display *dpy, picture_info *win, picture_info *dst, int op, /* Fill the dst to dst_color */ XRenderComposite(dpy, PictOpSrc, dst_color->pict, None, dst->pict, 0, 0, - 0, 0, 0, 0, win_width, win_height); + 0, 0, 0, 0, TEST_WIDTH, TEST_HEIGHT); /* Paint the triangles with src_color */ XRenderCompositeTriFan(dpy, ops[op].op, src_color->pict, dst->pict, XRenderFindStandardFormat(dpy, PictStandardA8), 0, 0, points, 4); - copy_pict_to_win(dpy, dst, win); + copy_pict_to_win(dpy, dst, win, TEST_WIDTH, TEST_HEIGHT); /* Color expected outside of the triangles */ tdst = dst_color->color; @@ -190,12 +193,12 @@ tristrip_test(Display *dpy, picture_info *win, picture_info *dst, int op, /* Fill the dst to dst_color */ XRenderComposite(dpy, PictOpSrc, dst_color->pict, None, dst->pict, 0, 0, - 0, 0, 0, 0, win_width, win_height); + 0, 0, 0, 0, TEST_WIDTH, TEST_HEIGHT); /* Paint the triangles with src_color */ XRenderCompositeTriStrip(dpy, ops[op].op, src_color->pict, dst->pict, XRenderFindStandardFormat(dpy, PictStandardA8), 0, 0, points, 4); - copy_pict_to_win(dpy, dst, win); + copy_pict_to_win(dpy, dst, win, TEST_WIDTH, TEST_HEIGHT); /* Color expected outside of the triangles */ tdst = dst_color->color; @@ -749,11 +749,12 @@ do { \ * indicates that this behavior should be disabled. */ void -copy_pict_to_win(Display *dpy, picture_info *pict, picture_info *win) +copy_pict_to_win(Display *dpy, picture_info *pict, picture_info *win, + int width, int height) { if (pict == win || minimalrendering) return; XRenderComposite(dpy, PictOpSrc, pict->pict, 0, win->pict, 0, 0, - 0, 0, 0, 0, win_width, win_height); + 0, 0, 0, 0, width, height); } |