diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-09-27 22:23:14 +0100 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2018-09-28 20:02:54 +0000 |
commit | feca61cdb5351bbe178f7083938a973703aff866 (patch) | |
tree | 23232963ed08968c62c05e7d324807879073a350 | |
parent | d1c00c859c6676fbb540420c9055788bc19cb18f (diff) | |
download | xserver-feca61cdb5351bbe178f7083938a973703aff866.tar.gz |
test: Initialize the pixmap in damage test
-rw-r--r-- | test/damage/primitives.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/damage/primitives.c b/test/damage/primitives.c index 5ee63b689..ac851c581 100644 --- a/test/damage/primitives.c +++ b/test/damage/primitives.c @@ -241,6 +241,18 @@ create_start_pixmap(struct test_setup *setup) setup->start_drawable, setup->screen->root, setup->width, setup->height); + /* Fill pixmap so it has defined contents */ + xcb_gc_t fill = xcb_generate_id(setup->c); + uint32_t fill_values[] = { setup->screen->white_pixel }; + xcb_create_gc(setup->c, fill, setup->screen->root, + XCB_GC_FOREGROUND, fill_values); + + xcb_rectangle_t rect_all = { 0, 0, setup->width, setup->height}; + xcb_poly_fill_rectangle(setup->c, setup->start_drawable, + fill, 1, &rect_all); + xcb_free_gc(setup->c, fill); + + /* Draw a rectangle */ xcb_gc_t gc = xcb_generate_id(setup->c); uint32_t values[] = { 0xaaaaaaaa }; xcb_create_gc(setup->c, gc, setup->screen->root, |