summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2012-03-16 17:25:09 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-03-20 22:43:55 -0400
commite2d21e82fc93edae351acabb3e734953f8397c8c (patch)
tree97cc612343ad5b8e2a7af6d401cfa91d33af9357
parent6dc0f86dbd53ffc064361ab07b6cee696f61f25f (diff)
compositor-wayland: use image loading code from shared/
Function weston_load_image() was deleted in f02a649a but the wayland backend was not adapted to the new interface. This probably went unoticed because the prototype for the missing function was not deleted from compositor.h so the backend would compile without warnings.
-rw-r--r--src/Makefile.am3
-rw-r--r--src/compositor-wayland.c16
-rw-r--r--src/compositor.h5
3 files changed, 12 insertions, 12 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 67c7414..672110a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -74,7 +74,8 @@ endif
if ENABLE_WAYLAND_COMPOSITOR
wayland_backend = wayland-backend.la
wayland_backend_la_LDFLAGS = -module -avoid-version
-wayland_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(WAYLAND_COMPOSITOR_LIBS)
+wayland_backend_la_LIBADD = $(COMPOSITOR_LIBS) $(WAYLAND_COMPOSITOR_LIBS) \
+ ../shared/libconfig-parser.la
wayland_backend_la_CFLAGS = $(WAYLAND_COMPOSITOR_CFLAGS) $(GCC_CFLAGS)
wayland_backend_la_SOURCES = compositor-wayland.c
endif
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index 48358e3..b4c55a8 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -206,16 +206,17 @@ draw_border(struct wayland_output *output)
static void
create_border(struct wayland_compositor *c)
{
- uint32_t *pixels, stride;
+ pixman_image_t *image;
- pixels = weston_load_image(DATADIR "/weston/border.png",
- &c->border.width,
- &c->border.height, &stride);
- if (!pixels) {
+ image = load_image(DATADIR "/weston/border.png");
+ if (!image) {
fprintf(stderr, "could'nt load border image\n");
return;
}
+ c->border.width = pixman_image_get_width(image);
+ c->border.height = pixman_image_get_height(image);
+
glGenTextures(1, &c->border.texture);
glBindTexture(GL_TEXTURE_2D, c->border.texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
@@ -226,12 +227,15 @@ create_border(struct wayland_compositor *c)
glTexImage2D(GL_TEXTURE_2D, 0, GL_BGRA_EXT,
c->border.width,
c->border.height,
- 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, pixels);
+ 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE,
+ pixman_image_get_data(image));
c->border.top = 25;
c->border.bottom = 50;
c->border.left = 25;
c->border.right = 25;
+
+ pixman_image_unref(image);
}
static int
diff --git a/src/compositor.h b/src/compositor.h
index 16389a6..a7e30f1 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -506,11 +506,6 @@ screenshooter_create(struct weston_compositor *ec);
void
screenshooter_destroy(struct screenshooter *s);
-uint32_t *
-weston_load_image(const char *filename,
- int32_t *width_arg, int32_t *height_arg,
- uint32_t *stride_arg);
-
struct weston_process;
typedef void (*weston_process_cleanup_func_t)(struct weston_process *process,
int status);