diff options
author | Jasmine Hassan <[email protected]> | 2012-10-18 12:31:22 +0200 |
---|---|---|
committer | Jasmine Hassan <[email protected]> | 2012-11-13 06:25:03 +0200 |
commit | e68ea5c0a9cd2f4f1d88cc9fd38f1e80b2399291 (patch) | |
tree | 27cfb89ad80825eed33d81cfdb2dfdad5fb673d2 /eel/eel-debug-drawing.c | |
parent | adfba98c507fd731a96a0551176050b697c14379 (diff) | |
download | caja-e68ea5c0a9cd2f4f1d88cc9fd38f1e80b2399291.tar.bz2 caja-e68ea5c0a9cd2f4f1d88cc9fd38f1e80b2399291.tar.xz |
[eel] port eel-debug-drawing to cairo drawing
http://git.gnome.org/browse/nautilus/commit/?id=e716f82eea847e5298d773e2689642813db3d36e
Diffstat (limited to 'eel/eel-debug-drawing.c')
-rw-r--r-- | eel/eel-debug-drawing.c | 53 |
1 files changed, 19 insertions, 34 deletions
diff --git a/eel/eel-debug-drawing.c b/eel/eel-debug-drawing.c index 50ea70a4..6c98748a 100644 --- a/eel/eel-debug-drawing.c +++ b/eel/eel-debug-drawing.c @@ -184,13 +184,9 @@ debug_pixbuf_viewer_expose_event (GtkWidget *widget, GdkEventExpose *event) eel_gdk_pixbuf_draw_to_drawable (viewer->pixbuf, event->window, - gtk_widget_get_style (widget)->white_gc, clipped_bounds.x0 - bounds.x0, clipped_bounds.y0 - bounds.y0, - clipped_bounds, - GDK_RGB_DITHER_NONE, - GDK_PIXBUF_ALPHA_BILEVEL, - EEL_STANDARD_ALPHA_THRESHHOLD); + clipped_bounds); } } @@ -229,7 +225,7 @@ eel_debug_draw_rectangle_and_cross (GdkDrawable *drawable, guint32 color, gboolean draw_cross) { - GdkGC *gc; + cairo_t *cr; GdkColor color_gdk = { 0 }; int width; @@ -241,43 +237,32 @@ eel_debug_draw_rectangle_and_cross (GdkDrawable *drawable, width = rectangle.x1 - rectangle.x0; height = rectangle.y1 - rectangle.y0; - gc = gdk_gc_new (drawable); - gdk_gc_set_function (gc, GDK_COPY); + cr = gdk_cairo_create (drawable); color_gdk.red = ((color >> 16) & 0xff) << 8; color_gdk.green = ((color >> 8) & 0xff) << 8; color_gdk.blue = ((color ) & 0xff) << 8; - gdk_colormap_alloc_color ( - gdk_drawable_get_colormap (drawable), - &color_gdk, FALSE, FALSE); - gdk_gc_set_rgb_fg_color (gc, &color_gdk); - - gdk_draw_rectangle (drawable, - gc, - FALSE, - rectangle.x0, - rectangle.y0, - width - 1, - height - 1); + gdk_cairo_set_source_color (cr, &color_gdk); + cairo_set_line_width (cr, 1.0); + + cairo_rectangle (cr, + rectangle.x0 + 0.5, + rectangle.y0 + 0.5, + width, + height); if (draw_cross) { - gdk_draw_line (drawable, - gc, - rectangle.x0, - rectangle.y0, - rectangle.x0 + width - 1, - rectangle.y0 + height - 1); - - gdk_draw_line (drawable, - gc, - rectangle.x0 + width - 1, - rectangle.y0, - rectangle.x0, - rectangle.y0 + height - 1); + cairo_move_to (cr, rectangle.x0, rectangle.y0); + cairo_line_to (cr, rectangle.x0 + width, rectangle.y0 + height); + + cairo_move_to (cr, rectangle.x0 + width, rectangle.y0); + cairo_line_to (cr, rectangle.x0, rectangle.y0 + height); } - g_object_unref (gc); + cairo_stroke (cr); + + cairo_destroy (cr); } /** |