summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Massey <bart@cs.pdx.edu>2007-12-08 18:12:27 -0800
committerArnaud Fontaine <arnau@debian.org>2010-11-14 20:03:27 +0900
commit5bd50f856c0fe5013b8554dfe82085b66149d79e (patch)
tree957e18d217f000ffb6cdf8d03a07401db2fbd1b5
parentaa4e6db33291fd00a14277456c43c73e6fc4f2a2 (diff)
added INSET argument to test_bitmap and cleaned up subimage stuff
-rw-r--r--image/test_bitmap.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/image/test_bitmap.c b/image/test_bitmap.c
index 06dbfd3..fe1b3bb 100644
--- a/image/test_bitmap.c
+++ b/image/test_bitmap.c
@@ -76,11 +76,12 @@ void process_events(xcb_connection_t *c,
}
}
-#define INSET 18
+#define INSET_X 31
+#define INSET_Y 32
int main(int argc, char **argv) {
- uint32_t width = test_width - 2 * INSET;
- uint32_t height = test_height - 2 * INSET;
+ uint32_t width = test_width - 2 * INSET_X;
+ uint32_t height = test_height - 2 * INSET_Y;
int snum;
xcb_void_cookie_t check_cookie;
xcb_window_t w;
@@ -100,7 +101,6 @@ int main(int argc, char **argv) {
xcb_alloc_named_color_reply(c, fg_cookie, 0);
uint32_t fg, bg;
xcb_image_t *image, *native_image, *subimage;
- uint32_t left_pad = 0;
uint32_t mask = 0;
xcb_params_gc_t gcv;
@@ -119,9 +119,9 @@ int main(int argc, char **argv) {
assert(native_image);
if (native_image != image)
xcb_image_destroy(image);
- subimage = xcb_image_subimage(native_image, INSET, INSET,
+ subimage = xcb_image_subimage(native_image, INSET_X, INSET_Y,
width, height,
- 0, 0, 0, &left_pad);
+ 0, 0, 0);
assert(subimage);
xcb_image_destroy(native_image);
subimage->format = XCB_IMAGE_FORMAT_XY_BITMAP;
@@ -132,7 +132,7 @@ int main(int argc, char **argv) {
XCB_AUX_ADD_PARAM(&mask, &gcv, foreground, fg);
XCB_AUX_ADD_PARAM(&mask, &gcv, background, bg);
xcb_aux_create_gc(c, gc, pix, mask, &gcv);
- xcb_image_put(c, pix, gc, subimage, 0, 0, left_pad);
+ xcb_image_put(c, pix, gc, subimage, 0, 0, 0);
process_events(c, gc, w, pix, width, height);
xcb_disconnect(c);
return 1;