diff options
author | Javier Jardón <javierjc1982@gmail.com> | 2009-10-09 18:13:00 +0200 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2010-05-03 01:48:45 +0200 |
commit | 906a510007bab86b3ad80c39f7ef9b25c36f3117 (patch) | |
tree | a22612b7a5a53f934ccf9e92dc5b31d830b3ee9a /gdk/testgdk.c | |
parent | 7894951cee33bb10c7c8bf901827dd2c24abe625 (diff) | |
download | gtk+-906a510007bab86b3ad80c39f7ef9b25c36f3117.tar.gz |
Remove deprecated code from GdkImage
Diffstat (limited to 'gdk/testgdk.c')
-rw-r--r-- | gdk/testgdk.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/gdk/testgdk.c b/gdk/testgdk.c index 2209e44ea7..9b4687c0c6 100644 --- a/gdk/testgdk.c +++ b/gdk/testgdk.c @@ -364,12 +364,12 @@ test_pixmaps (gint depth) gdk_window_get_size (pixmap, &w, &h); QTESTF (w == width, (" w:%d", w)); QTESTF (h == height, (" h:%d", h)); - image = gdk_image_get (pixmap, 0, 0, w, h); + image = gdk_drawable_get_image (pixmap, 0, 0, w, h); QTEST (image != NULL); QTEST (image->width == width); QTEST (image->height == height); QTEST (image->depth == depth); - gdk_image_destroy (image); + g_object_unref (image); g_object_unref (pixmap); } TEST (retval); @@ -405,7 +405,7 @@ test_images (void) QTEST (image->depth == system_visual->depth); QTEST (image->bpp >= (image->depth-1)/8 + 1); QTEST (image->mem != NULL); - gdk_image_destroy (image); + g_object_unref (image); } } TEST (retval); @@ -512,14 +512,14 @@ test_one_point_on_drawable (GdkDrawable *drawable, gdk_gc_get_values (gc, &gcvalues); - image = gdk_image_get (drawable, x+-1, y+-1, 3, 3); + image = gdk_drawable_get_image (drawable, x+-1, y+-1, 3, 3); QTEST (image != NULL); for (xoff = -1; xoff <= 1; xoff++) for (yoff = -1; yoff <= 1; yoff++) { oldpixels[xoff+1][yoff+1] = gdk_image_get_pixel (image, xoff+1, yoff+1); } - gdk_image_destroy (image); + g_object_unref (image); if (depth == 32) mask = 0xFFFFFFFF; @@ -528,7 +528,7 @@ test_one_point_on_drawable (GdkDrawable *drawable, gdk_draw_point (drawable, gc, x, y); - image = gdk_image_get (drawable, x-1, y-1, 3, 3); + image = gdk_drawable_get_image (drawable, x-1, y-1, 3, 3); QTEST (image != NULL); for (xoff = -1; xoff <= 1; xoff++) for (yoff = -1; yoff <= 1; yoff++) @@ -540,7 +540,7 @@ test_one_point_on_drawable (GdkDrawable *drawable, else QTEST (newpixel == oldpixels[xoff+1][yoff+1]); } - gdk_image_destroy (image); + g_object_unref (image); } @@ -601,7 +601,7 @@ test_one_line_on_drawable (GdkDrawable *drawable, w_up = w_left = line_width/2; w_down = w_right = (line_width & 1) ? line_width/2 : line_width/2-1; gdk_window_get_size (drawable, &w, &h); - oldimage = gdk_image_get (drawable, 0, 0, w, h); + oldimage = gdk_drawable_get_image (drawable, 0, 0, w, h); if (depth == 32) mask = 0xFFFFFFFF; @@ -616,7 +616,7 @@ test_one_line_on_drawable (GdkDrawable *drawable, const gint y2 = y1; gdk_draw_line (drawable, gc, x1, y1, x2, y2); - newimage = gdk_image_get (drawable, 0, 0, w, h); + newimage = gdk_drawable_get_image (drawable, 0, 0, w, h); for (x = x1-1; x <= x2+1; x++) for (y = y1-w_up-1; y <= y1+w_down+1; y++) { @@ -637,7 +637,7 @@ test_one_line_on_drawable (GdkDrawable *drawable, const gint y2 = 13; gdk_draw_line (drawable, gc, x1, y1, x2, y2); - newimage = gdk_image_get (drawable, 0, 0, w, h); + newimage = gdk_drawable_get_image (drawable, 0, 0, w, h); for (x = x1-w_left-1; x <= x1+w_right+1; x++) for (y = y1-1; y <= y2+1; y++) { @@ -651,8 +651,8 @@ test_one_line_on_drawable (GdkDrawable *drawable, } } - gdk_image_destroy (oldimage); - gdk_image_destroy (newimage); + g_object_unref (oldimage); + g_object_unref (newimage); } /* Test drawing lines. @@ -715,7 +715,7 @@ test_one_rectangle_on_drawable (GdkDrawable *drawable, } gdk_window_get_size (drawable, &w, &h); - oldimage = gdk_image_get (drawable, 0, 0, w, h); + oldimage = gdk_drawable_get_image (drawable, 0, 0, w, h); if (depth == 32) mask = 0xFFFFFFFF; @@ -723,7 +723,7 @@ test_one_rectangle_on_drawable (GdkDrawable *drawable, mask = (1 << depth) - 1; gdk_draw_rectangle (drawable, gc, filled, x0, y0, width, height); - newimage = gdk_image_get (drawable, 0, 0, w, h); + newimage = gdk_drawable_get_image (drawable, 0, 0, w, h); for (x = x0 - 1; x <= x0 + width + 1; x++) for (y = y0 - 1; y < y0 + height + 1; y++) @@ -757,8 +757,8 @@ test_one_rectangle_on_drawable (GdkDrawable *drawable, } } - gdk_image_destroy (oldimage); - gdk_image_destroy (newimage); + g_object_unref (oldimage); + g_object_unref (newimage); } /* Test drawing rectangles. @@ -821,7 +821,7 @@ test_some_arcs_on_drawable (GdkDrawable *drawable, } gdk_window_get_size (drawable, &w, &h); - oldimage = gdk_image_get (drawable, 0, 0, w, h); + oldimage = gdk_drawable_get_image (drawable, 0, 0, w, h); if (depth == 32) mask = 0xFFFFFFFF; @@ -829,7 +829,7 @@ test_some_arcs_on_drawable (GdkDrawable *drawable, mask = (1 << depth) - 1; /* XXX */ - newimage = gdk_image_get (drawable, 0, 0, w, h); + newimage = gdk_drawable_get_image (drawable, 0, 0, w, h); for (x = x0 - 1; x <= x0 + width + 1; x++) for (y = y0 - 1; y < y0 + height + 1; y++) @@ -847,8 +847,8 @@ test_some_arcs_on_drawable (GdkDrawable *drawable, } } - gdk_image_destroy (oldimage); - gdk_image_destroy (newimage); + g_object_unref (oldimage); + g_object_unref (newimage); } /* Test drawing arcs. Results don't have to be exactly as on X11, |