summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2011-02-13 12:55:37 +0100
committerCarlos Garcia Campos <carlosgc@gnome.org>2011-02-13 12:55:37 +0100
commitf410cd11268254b9d0422201c9860d775f73fdd8 (patch)
tree3967a5aea8430ce80750194b64ac3505dcfca88d /test
parenta0568e449061d6b6af5485e340cd6f9d3e54ef7c (diff)
gtk-splash-test: Don't use GDK deprecated API
Diffstat (limited to 'test')
-rw-r--r--test/gtk-splash-test.cc28
1 files changed, 15 insertions, 13 deletions
diff --git a/test/gtk-splash-test.cc b/test/gtk-splash-test.cc
index d5a41d30..59fba286 100644
--- a/test/gtk-splash-test.cc
+++ b/test/gtk-splash-test.cc
@@ -63,7 +63,7 @@ public:
// Copy the rectangle (srcX, srcY, width, height) to (destX, destY)
// in destDC.
void redraw(int srcX, int srcY,
- GdkDrawable *drawable,
+ GdkWindow *drawable,
int destX, int destY,
int width, int height);
@@ -120,23 +120,25 @@ void GDKSplashOutputDev::updateFont(GfxState *state) {
}
void GDKSplashOutputDev::redraw(int srcX, int srcY,
- GdkDrawable *drawable,
+ GdkWindow *drawable,
int destX, int destY,
int width, int height) {
- GdkGC *gc;
+ cairo_t *cr;
+ GdkPixbuf *pixbuf;
int gdk_rowstride;
gdk_rowstride = getBitmap()->getRowSize();
- gc = gdk_gc_new (drawable);
-
- gdk_draw_rgb_image (drawable, gc,
- destX, destY,
- width, height,
- GDK_RGB_DITHER_NORMAL,
- getBitmap()->getDataPtr() + srcY * gdk_rowstride + srcX * 3,
- gdk_rowstride);
-
- g_object_unref (gc);
+ pixbuf = gdk_pixbuf_new_from_data (getBitmap()->getDataPtr() + srcY * gdk_rowstride + srcX * 3,
+ GDK_COLORSPACE_RGB, FALSE, 8,
+ width, height, gdk_rowstride,
+ NULL, NULL);
+
+ cr = gdk_cairo_create (drawable);
+ gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
+ cairo_paint (cr);
+ cairo_destroy (cr);
+
+ g_object_unref (pixbuf);
}