#include <EGL/eglext.h>
#include "compositor.h"
+#include "log.h"
struct wayland_compositor {
struct weston_compositor base;
image = load_image(DATADIR "/weston/border.png");
if (!image) {
- fprintf(stderr, "could'nt load border image\n");
+ weston_log("could'nt load border image\n");
return;
}
c->base.display = eglGetDisplay(c->parent.display);
if (c->base.display == NULL) {
- fprintf(stderr, "failed to create display\n");
+ weston_log("failed to create display\n");
return -1;
}
if (!eglInitialize(c->base.display, &major, &minor)) {
- fprintf(stderr, "failed to initialize display\n");
+ weston_log("failed to initialize display\n");
return -1;
}
if (!eglBindAPI(EGL_OPENGL_ES_API)) {
- fprintf(stderr, "failed to bind EGL_OPENGL_ES_API\n");
+ weston_log("failed to bind EGL_OPENGL_ES_API\n");
return -1;
}
if (!eglChooseConfig(c->base.display, config_attribs,
&c->base.config, 1, &n) || n == 0) {
- fprintf(stderr, "failed to choose config: %d\n", n);
+ weston_log("failed to choose config: %d\n", n);
return -1;
}
c->base.context = eglCreateContext(c->base.display, c->base.config,
EGL_NO_CONTEXT, context_attribs);
if (c->base.context == NULL) {
- fprintf(stderr, "failed to create context\n");
+ weston_log("failed to create context\n");
return -1;
}
c->dummy_pixmap = wl_egl_pixmap_create(10, 10, 0);
if (!c->dummy_pixmap) {
- fprintf(stderr, "failure to create dummy_pixmap\n");
+ weston_log("failure to create dummy_pixmap\n");
return -1;
}
c->dummy_pixmap, NULL);
if (!eglMakeCurrent(c->base.display, c->dummy_egl_surface,
c->dummy_egl_surface, c->base.context)) {
- fprintf(stderr, "failed to make context current\n");
+ weston_log("failed to make context current\n");
return -1;
}
if (!eglMakeCurrent(compositor->base.display, output->egl_surface,
output->egl_surface, compositor->base.context)) {
- fprintf(stderr, "failed to make current\n");
+ weston_log("failed to make current\n");
return;
}
width + c->border.left + c->border.right,
height + c->border.top + c->border.bottom);
if (!output->parent.egl_window) {
- fprintf(stderr, "failure to create wl_egl_window\n");
+ weston_log("failure to create wl_egl_window\n");
goto cleanup_output;
}
eglCreateWindowSurface(c->base.display, c->base.config,
output->parent.egl_window, NULL);
if (!output->egl_surface) {
- fprintf(stderr, "failed to create window surface\n");
+ weston_log("failed to create window surface\n");
goto cleanup_window;
}
if (!eglMakeCurrent(c->base.display, output->egl_surface,
output->egl_surface, c->base.context)) {
- fprintf(stderr, "failed to make surface current\n");
+ weston_log("failed to make surface current\n");
goto cleanup_surface;
return -1;
}
close(fd);
if (!keymap) {
- fprintf(stderr, "failed to compile keymap\n");
+ weston_log("failed to compile keymap\n");
return;
}
c->parent.display = wl_display_connect(display_name);
if (c->parent.display == NULL) {
- fprintf(stderr, "failed to create display: %m\n");
+ weston_log("failed to create display: %m\n");
return NULL;
}