summaryrefslogtreecommitdiff
path: root/t_gradient.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2016-02-01 13:48:43 -0800
committerAdam Jackson <ajax@redhat.com>2016-02-08 16:13:12 -0500
commitc717994102c1e190c0131b57915693b951ed81b7 (patch)
tree81308a890449c80cfbc25770e2828dadcb77842d /t_gradient.c
parent604e3bbe6d8d96bec284a83c08c5cc5f159a243c (diff)
Start using stdbool.h instead of Xlib or custom bools.
I have a hard time typing anything else at this point. Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 't_gradient.c')
-rw-r--r--t_gradient.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/t_gradient.c b/t_gradient.c
index 32df8c4..a489fe2 100644
--- a/t_gradient.c
+++ b/t_gradient.c
@@ -85,20 +85,20 @@ static const pixel test_pixels [] = {
static const int n_linear_gradient_points = sizeof(linear_gradient_points)/(2*sizeof(point));
-static Bool got_bad_drawable;
+static bool got_bad_drawable;
static int expecting_bad_drawable(Display *dpy, XErrorEvent *event)
{
if (event->error_code == BadDrawable)
- got_bad_drawable = TRUE;
+ got_bad_drawable = true;
- return TRUE;
+ return true;
}
/* Tests that rendering to a linear gradient returns an error as expected.
*/
-Bool
+bool
render_to_gradient_test(Display *dpy, picture_info *src)
{
XLinearGradient g;
@@ -124,39 +124,39 @@ render_to_gradient_test(Display *dpy, picture_info *src)
gradient = XRenderCreateLinearGradient(dpy, &g, stops, colors, i);
/* Clear out any failing requests before our expected to fail ones. */
- XSync(dpy, FALSE);
+ XSync(dpy, false);
- got_bad_drawable = FALSE;
+ got_bad_drawable = false;
XSetErrorHandler(expecting_bad_drawable);
/* Try a real compositing path */
XRenderComposite(dpy, PictOpOver, src->pict, 0, gradient,
0, 0, 0, 0, 0, 0, win_width, win_height);
- XSync(dpy, FALSE);
+ XSync(dpy, false);
if (!got_bad_drawable) {
printf("render_to_gradient: Failed to get BadDrawable with "
"Over\n");
- return FALSE;
+ return false;
} else {
- got_bad_drawable = FALSE;
+ got_bad_drawable = false;
}
/* Try the copy path to catch bad short-circuiting to 2d. */
XRenderComposite(dpy, PictOpSrc, src->pict, 0, gradient,
0, 0, 0, 0, 0, 0, win_width, win_height);
- XSync(dpy, FALSE);
+ XSync(dpy, false);
if (!got_bad_drawable) {
printf("render_to_gradient: Failed to get BadDrawable with "
"Src\n");
- return FALSE;
+ return false;
} else {
- got_bad_drawable = FALSE;
+ got_bad_drawable = false;
}
XSetErrorHandler(NULL);
XRenderFreePicture(dpy, gradient);
- return TRUE;
+ return true;
}
static void gradientPixel(const stop *stops, double pos, unsigned int spread, color4d *result)
@@ -247,14 +247,14 @@ static void calculate_linear_gradient_color(int x, int y,
-Bool linear_gradient_test(Display *dpy, picture_info *win,
+bool linear_gradient_test(Display *dpy, picture_info *win,
picture_info *dst, int op, picture_info *dst_color)
{
color4d expected, tested, tdst, tgradient;
int i, s, p, repeat;
Picture gradient;
char testname[40];
- Bool success = True;
+ bool success = true;
for (s = 0; s < n_stop_list; ++s) {
for (p = 0; p < n_linear_gradient_points; p += 2) {
@@ -321,7 +321,7 @@ Bool linear_gradient_test(Display *dpy, picture_info *win,
tgradient.b, tgradient.a,
dst_color->color.r, dst_color->color.g,
dst_color->color.b, dst_color->color.a);
- success = FALSE;
+ success = false;
} else if (is_verbose) {
printf("src: %d/%d, dst: %s\n", s, p, dst->name);
}