summaryrefslogtreecommitdiff
path: root/clients/desktop-shell.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-10-20 13:11:12 -0400
committerKristian Høgsberg <krh@bitplanet.net>2011-10-20 13:11:12 -0400
commit27d38660459971a039fbbe9ec95a1cec7470634b (patch)
treeddd853cfbe0e353dd5d70afa28f6f905dd6122f8 /clients/desktop-shell.c
parent9ef9e0ecf95c575479c8b6a3f1da10ce46575f3c (diff)
cairo-util: Add helper to load jpeg files
Diffstat (limited to 'clients/desktop-shell.c')
-rw-r--r--clients/desktop-shell.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 7ad6f02..016d720 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -32,6 +32,7 @@
#include <linux/input.h>
#include "wayland-client.h"
+#include "cairo-util.h"
#include "window.h"
#include <desktop-shell-client-protocol.h>
@@ -241,7 +242,7 @@ background_draw(struct window *window, int width, int height, const char *path)
cairo_paint(cr);
if (path) {
- image = cairo_image_surface_create_from_png(path);
+ image = load_jpeg(path);
pattern = cairo_pattern_create_for_surface(image);
sx = (double) cairo_image_surface_get_width(image) / width;
sy = (double) cairo_image_surface_get_height(image) / height;
@@ -250,6 +251,7 @@ background_draw(struct window *window, int width, int height, const char *path)
cairo_set_source(cr, pattern);
cairo_pattern_destroy (pattern);
cairo_paint(cr);
+ cairo_surface_destroy(image);
}
cairo_destroy(cr);