diff options
author | Benjamin Otte <otte@redhat.com> | 2010-07-12 15:45:12 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2010-07-26 16:42:47 +0200 |
commit | 6d4bae5cccdf34b9bd1ac613d639befcc742d369 (patch) | |
tree | 0cbc87c76b6af41e3123de89c1e378f9276cbdaf /tests/testrgb.c | |
parent | c1c9b7dfc8ac22edd9110a40fd1fb97e9585cd88 (diff) | |
download | gtk+-6d4bae5cccdf34b9bd1ac613d639befcc742d369.tar.gz |
tests: Remove gdk_draw_pixbuf() with Cairo equivalent
Diffstat (limited to 'tests/testrgb.c')
-rw-r--r-- | tests/testrgb.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/testrgb.c b/tests/testrgb.c index f4fdbc2cff..b05018359d 100644 --- a/tests/testrgb.c +++ b/tests/testrgb.c @@ -147,15 +147,17 @@ testrgb_rgb_test (GtkWidget *drawing_area) start_time = g_timer_elapsed (timer, NULL); for (i = 0; i < NUM_ITERS; i++) { + cairo_t *cr; + offset = (rand () % (WIDTH * HEIGHT * 4)) & -4; pixbuf = gdk_pixbuf_new_from_data (buf + offset, GDK_COLORSPACE_RGB, TRUE, 8, WIDTH, HEIGHT, WIDTH * 4, NULL, NULL); - gdk_draw_pixbuf (drawing_area->window, drawing_area->style->black_gc, - pixbuf, - 0, 0, 0, 0, WIDTH, HEIGHT, - GDK_RGB_DITHER_NORMAL, - 0, 0); + cr = gdk_cairo_create (drawing_area->window); + gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); + cairo_rectangle (cr, 0, 0, WIDTH, HEIGHT); + cairo_fill (cr); + cairo_destroy (cr); g_object_unref (pixbuf); } gdk_flush (); |