[gnome-screensaver] slideshow: avoid roundtrip when copying pixbuf regions
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-screensaver] slideshow: avoid roundtrip when copying pixbuf regions
- Date: Wed, 29 Sep 2010 16:47:24 +0000 (UTC)
commit 67d07119a74f9c6cc17701f3a41b6d20e4337b9f
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Sep 29 11:59:02 2010 -0400
slideshow: avoid roundtrip when copying pixbuf regions
slideshow goes through some contortions with pixmaps to
copy one pixbuf to another. This commit changes that
code to just use gdk_pixbuf_copy_area instead.
https://bugzilla.gnome.org/show_bug.cgi?id=630593
savers/gste-slideshow.c | 16 ++++------------
1 files changed, 4 insertions(+), 12 deletions(-)
---
diff --git a/savers/gste-slideshow.c b/savers/gste-slideshow.c
index b436078..00f44e8 100644
--- a/savers/gste-slideshow.c
+++ b/savers/gste-slideshow.c
@@ -170,7 +170,6 @@ start_fade (GSTESlideshow *show,
if (gdk_pixbuf_get_has_alpha (pixbuf) && show->priv->background_color) {
GdkPixbuf *colored;
guint32 color;
- GdkPixmap *pixmap;
color = (show->priv->background_color->red << 16)
+ (show->priv->background_color->green / 256 << 8)
@@ -182,17 +181,10 @@ start_fade (GSTESlideshow *show,
256,
color,
color);
-#if GTK_CHECK_VERSION (2,21,1)
- pixmap = gdk_pixmap_new (NULL, ph, pw, gdk_visual_get_depth (gdk_visual_get_system ()));
-#else
- pixmap = gdk_pixmap_new (NULL, ph, pw, gdk_visual_get_system ()->depth);
-#endif
-
- gdk_draw_pixbuf (pixmap, NULL, colored, 0, 0, 0, 0, -1, -1, GDK_RGB_DITHER_MAX, 0, 0);
- gdk_pixbuf_get_from_drawable (pixbuf, pixmap, NULL, 0, 0, 0, 0, -1, -1);
-
- g_object_unref (pixmap);
-
+ gdk_pixbuf_copy_area (colored, 0, 0,
+ gdk_pixbuf_get_width (colored),
+ gdk_pixbuf_get_height (colored),
+ pixbuf, 0, 0);
g_object_unref(colored);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]