summaryrefslogtreecommitdiff
path: root/eel/eel-gdk-pixbuf-extensions.c
diff options
context:
space:
mode:
Diffstat (limited to 'eel/eel-gdk-pixbuf-extensions.c')
-rw-r--r--eel/eel-gdk-pixbuf-extensions.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/eel/eel-gdk-pixbuf-extensions.c b/eel/eel-gdk-pixbuf-extensions.c
index a75158db..62bc58eb 100644
--- a/eel/eel-gdk-pixbuf-extensions.c
+++ b/eel/eel-gdk-pixbuf-extensions.c
@@ -649,13 +649,9 @@ eel_gdk_pixbuf_unref_if_not_null (GdkPixbuf *pixbuf_or_null)
void
eel_gdk_pixbuf_draw_to_drawable (const GdkPixbuf *pixbuf,
GdkDrawable *drawable,
- GdkGC *gc,
int source_x,
int source_y,
- EelIRect destination_area,
- GdkRgbDither dither,
- GdkPixbufAlphaMode alpha_compositing_mode,
- int alpha_threshold)
+ EelIRect destination_area)
{
EelDimensions dimensions;
EelIRect target;
@@ -664,15 +660,11 @@ eel_gdk_pixbuf_draw_to_drawable (const GdkPixbuf *pixbuf,
int target_height;
int source_width;
int source_height;
+ cairo_t *cr;
g_return_if_fail (eel_gdk_pixbuf_is_valid (pixbuf));
g_return_if_fail (drawable != NULL);
- g_return_if_fail (gc != NULL);
g_return_if_fail (!eel_irect_is_empty (&destination_area));
- g_return_if_fail (alpha_threshold > EEL_OPACITY_FULLY_TRANSPARENT);
- g_return_if_fail (alpha_threshold <= EEL_OPACITY_FULLY_OPAQUE);
- g_return_if_fail (alpha_compositing_mode >= GDK_PIXBUF_ALPHA_BILEVEL);
- g_return_if_fail (alpha_compositing_mode <= GDK_PIXBUF_ALPHA_FULL);
dimensions = eel_gdk_pixbuf_get_dimensions (pixbuf);
@@ -707,16 +699,14 @@ eel_gdk_pixbuf_draw_to_drawable (const GdkPixbuf *pixbuf,
target.x1 = target.x0 + MIN (target_width, source_width);
target.y1 = target.y0 + MIN (target_height, source_height);
- gdk_draw_pixbuf (drawable, gc, (GdkPixbuf *) pixbuf,
- source.x0,
- source.y0,
- target.x0,
- target.y0,
+ cr = gdk_cairo_create (drawable);
+ gdk_cairo_set_source_pixbuf (cr, (GdkPixbuf *) pixbuf,
+ source.x0 - target.x0, source.y0 - target.y0);
+ cairo_rectangle (cr, target.x0, target.y0,
target.x1 - target.x0,
- target.y1 - target.y0,
- dither,
- 0,
- 0);
+ target.y1 - target.y0);
+ cairo_fill (cr);
+ cairo_destroy (cr);
}
/**