#endif
#include <stddef.h>
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include "compositor.h"
#include "../shared/config-parser.h"
+#include "log.h"
struct x11_compositor {
struct weston_compositor base;
c->base.display = eglGetDisplay(c->dpy);
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->base.config,
pbuffer_attribs);
if (c->dummy_pbuffer == NULL) {
- fprintf(stderr, "failed to create dummy pbuffer\n");
+ weston_log("failed to create dummy pbuffer\n");
return -1;
}
if (!eglMakeCurrent(c->base.display, c->dummy_pbuffer,
c->dummy_pbuffer, 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;
}
eglCreateWindowSurface(c->base.display, c->base.config,
output->window, NULL);
if (!output->egl_surface) {
- fprintf(stderr, "failed to create window surface\n");
+ weston_log("failed to create window surface\n");
return -1;
}
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");
return -1;
}