[Xfce4-commits] [xfce/xfwm4] 02/05: Switch back to bilinear interpolation
noreply at xfce.org
noreply at xfce.org
Sat Jan 24 22:41:06 CET 2015
This is an automated email from the git hooks/post-receive script.
olivier pushed a commit to branch master
in repository xfce/xfwm4.
commit b6f753b547e83c399e0c80921d3420b54f0f22a2
Author: Olivier Fourdan <fourdan at xfce.org>
Date: Sat Jan 24 21:29:26 2015 +0100
Switch back to bilinear interpolation
And apply saturation on iconified windows.
Signed-off-by: Olivier Fourdan <fourdan at xfce.org>
---
src/icons.c | 31 ++++++++++++++++++++-----------
src/mypixmap.c | 4 ++--
2 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/src/icons.c b/src/icons.c
index 64df233..259ad71 100644
--- a/src/icons.c
+++ b/src/icons.c
@@ -91,7 +91,7 @@ inline_icon_at_size (const guint8 *data, int width, int height)
w = gdk_pixbuf_get_width (base);
h = gdk_pixbuf_get_height (base);
downsize_ratio (&w, &h, width, height);
- scaled = gdk_pixbuf_scale_simple (base, w, h, GDK_INTERP_NEAREST);
+ scaled = gdk_pixbuf_scale_simple (base, w, h, GDK_INTERP_BILINEAR);
g_object_unref (G_OBJECT (base));
@@ -508,7 +508,7 @@ scaled_from_pixdata (guchar * pixdata, int w, int h, int dest_w, int dest_h)
if (w != dest_w || h != dest_h)
{
downsize_ratio (&w, &h, dest_w, dest_h);
- dest = gdk_pixbuf_scale_simple (src, w, h, GDK_INTERP_NEAREST);
+ dest = gdk_pixbuf_scale_simple (src, w, h, GDK_INTERP_BILINEAR);
g_object_unref (G_OBJECT (src));
}
else
@@ -582,22 +582,31 @@ GdkPixbuf *
getClientIcon (Client *c, int width, int height)
{
ScreenInfo *screen_info;
- DisplayInfo *display_info;
+ GdkPixbuf *icon_pixbuf;
+ GdkPixbuf *icon_pixbuf_stated;
Pixmap pixmap;
g_return_val_if_fail (c != NULL, NULL);
screen_info = c->screen_info;
- display_info = screen_info->display_info;
- pixmap = compositorGetWindowPixmap (display_info, c->frame);
+ icon_pixbuf = NULL;
+ pixmap = compositorGetWindowPixmap (screen_info, c->frame);
if (pixmap != None)
{
- GdkPixbuf *icon = try_pixmap_and_mask (screen_info, pixmap, None, width, height);
- if (icon)
- {
- return icon;
- }
+ icon_pixbuf = try_pixmap_and_mask (screen_info, pixmap, None, width, height);
+ }
+ if (!icon_pixbuf)
+ {
+ icon_pixbuf = getAppIcon (screen_info, c->window, width, height);
+ }
+
+ if (FLAG_TEST (c->flags, CLIENT_FLAG_ICONIFIED))
+ {
+ icon_pixbuf_stated = gdk_pixbuf_copy (icon_pixbuf);
+ gdk_pixbuf_saturate_and_pixelate (icon_pixbuf, icon_pixbuf_stated, 0.55, TRUE);
+ g_object_unref (icon_pixbuf);
+ icon_pixbuf = icon_pixbuf_stated;
}
- return getAppIcon (screen_info, c->window, width, height);
+ return icon_pixbuf;
}
diff --git a/src/mypixmap.c b/src/mypixmap.c
index 97e670f..0c51672 100644
--- a/src/mypixmap.c
+++ b/src/mypixmap.c
@@ -784,7 +784,7 @@ xfwmPixmapCompose (GdkPixbuf *pixbuf, const gchar * dir, const gchar * file)
gdk_pixbuf_get_height (alpha));
gdk_pixbuf_composite (alpha, pixbuf, 0, 0, width, height,
- 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 0xFF);
+ 0, 0, 1.0, 1.0, GDK_INTERP_BILINEAR, 0xFF);
g_object_unref (alpha);
@@ -921,7 +921,7 @@ xfwmPixmapRenderGdkPixbuf (xfwmPixmap * pm, GdkPixbuf *pixbuf)
src = gdk_pixbuf_get_from_drawable(NULL, GDK_DRAWABLE (destw), cmap,
dest_x, dest_y, 0, 0, width, height);
gdk_pixbuf_composite (pixbuf, src, 0, 0, width, height,
- 0, 0, 1.0, 1.0, GDK_INTERP_NEAREST, 0xFF);
+ 0, 0, 1.0, 1.0, GDK_INTERP_BILINEAR, 0xFF);
gdk_draw_pixbuf (GDK_DRAWABLE (destw), NULL, src, 0, 0, dest_x, dest_y,
width, height, GDK_RGB_DITHER_NONE, 0, 0);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list