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.c35
1 files changed, 3 insertions, 32 deletions
diff --git a/eel/eel-gdk-pixbuf-extensions.c b/eel/eel-gdk-pixbuf-extensions.c
index bbbffc3a..f86ad086 100644
--- a/eel/eel-gdk-pixbuf-extensions.c
+++ b/eel/eel-gdk-pixbuf-extensions.c
@@ -622,11 +622,7 @@ eel_gdk_pixbuf_unref_if_not_null (GdkPixbuf *pixbuf_or_null)
void
eel_gdk_pixbuf_draw_to_drawable (const GdkPixbuf *pixbuf,
-#if GTK_CHECK_VERSION (3, 0, 0)
cairo_t *cr,
-#else
- GdkDrawable *drawable,
-#endif
int source_x,
int source_y,
EelIRect destination_area)
@@ -638,16 +634,10 @@ eel_gdk_pixbuf_draw_to_drawable (const GdkPixbuf *pixbuf,
int target_height;
int source_width;
int source_height;
-#if !GTK_CHECK_VERSION (3, 0, 0)
- cairo_t *cr;
-#endif
g_return_if_fail (eel_gdk_pixbuf_is_valid (pixbuf));
-#if GTK_CHECK_VERSION (3, 0, 0)
g_return_if_fail (cr != NULL);
-#else
- g_return_if_fail (drawable != NULL);
-#endif
+
g_return_if_fail (!eel_irect_is_empty (&destination_area));
dimensions = eel_gdk_pixbuf_get_dimensions (pixbuf);
@@ -683,9 +673,6 @@ 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);
-#if !GTK_CHECK_VERSION (3, 0, 0)
- cr = gdk_cairo_create (drawable);
-#endif
gdk_cairo_set_source_pixbuf (cr, (GdkPixbuf *) pixbuf,
source.x0 - target.x0, source.y0 - target.y0);
cairo_rectangle (cr, target.x0, target.y0,
@@ -1265,11 +1252,8 @@ eel_gdk_pixbuf_render (GdkPixbuf *pixbuf,
guint saturation,
guint brightness,
guint lighten_value,
-#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA *color)
-#else
- guint color)
-#endif
+
{
GdkPixbuf *temp_pixbuf, *old_pixbuf;
@@ -1281,27 +1265,14 @@ eel_gdk_pixbuf_render (GdkPixbuf *pixbuf,
else if (render_mode == 2)
{
/* colorize icon */
-#if GTK_CHECK_VERSION(3,0,0)
temp_pixbuf = eel_create_colorized_pixbuf (pixbuf, color);
-#else
- temp_pixbuf = eel_create_colorized_pixbuf (pixbuf,
- EEL_RGBA_COLOR_GET_R (color),
- EEL_RGBA_COLOR_GET_G (color),
- EEL_RGBA_COLOR_GET_B (color));
-#endif
}
else if (render_mode == 3)
{
/* monochromely colorize icon */
old_pixbuf = eel_create_darkened_pixbuf (pixbuf, 0, 255);
-#if GTK_CHECK_VERSION(3,0,0)
temp_pixbuf = eel_create_colorized_pixbuf (old_pixbuf, color);
-#else
- temp_pixbuf = eel_create_colorized_pixbuf (old_pixbuf,
- EEL_RGBA_COLOR_GET_R (color),
- EEL_RGBA_COLOR_GET_G (color),
- EEL_RGBA_COLOR_GET_B (color));
-#endif
+
g_object_unref (old_pixbuf);
}
else