aboutsummaryrefslogtreecommitdiff
path: root/backend/headless
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2018-03-22 20:06:53 -0400
committerTony Crisci <tony@dubstepdish.com>2018-03-22 20:06:53 -0400
commit30b8fb5572cd59c096b00a26c7a41cd674e9337b (patch)
tree2a7de55685259200422f2bf23cab909fa788db54 /backend/headless
parent8836b167bf0ff152de951f7fdabb1deae85f6e93 (diff)
parent77d3be66eaabca4309794536984c54a5e94e9eb5 (diff)
Merge branch 'master' into xdg-positioner
Diffstat (limited to 'backend/headless')
-rw-r--r--backend/headless/output.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/backend/headless/output.c b/backend/headless/output.c
index 6ce8fc35..a13ed22c 100644
--- a/backend/headless/output.c
+++ b/backend/headless/output.c
@@ -1,8 +1,8 @@
#include <EGL/egl.h>
#include <EGL/eglext.h>
-#include <GLES2/gl2.h>
#include <stdlib.h>
#include <wlr/interfaces/wlr_output.h>
+#include <wlr/render/wlr_renderer.h>
#include <wlr/util/log.h>
#include "backend/headless.h"
#include "util/signal.h"
@@ -13,7 +13,7 @@ static EGLSurface egl_create_surface(struct wlr_egl *egl, unsigned int width,
EGLSurface surf = eglCreatePbufferSurface(egl->display, egl->config, attribs);
if (surf == EGL_NO_SURFACE) {
- wlr_log(L_ERROR, "Failed to create EGL surface: %s", egl_error());
+ wlr_log(L_ERROR, "Failed to create EGL surface");
return EGL_NO_SURFACE;
}
return surf;
@@ -120,16 +120,14 @@ struct wlr_output *wlr_headless_add_output(struct wlr_backend *wlr_backend,
snprintf(wlr_output->name, sizeof(wlr_output->name), "HEADLESS-%d",
wl_list_length(&backend->outputs) + 1);
- if (!eglMakeCurrent(output->backend->egl.display,
- output->egl_surface, output->egl_surface,
- output->backend->egl.context)) {
- wlr_log(L_ERROR, "eglMakeCurrent failed: %s", egl_error());
+ if (!wlr_egl_make_current(&output->backend->egl, output->egl_surface,
+ NULL)) {
goto error;
}
- glViewport(0, 0, wlr_output->width, wlr_output->height);
- glClearColor(1.0, 1.0, 1.0, 1.0);
- glClear(GL_COLOR_BUFFER_BIT);
+ wlr_renderer_begin(backend->renderer, wlr_output->width, wlr_output->height);
+ wlr_renderer_clear(backend->renderer, (float[]){ 1.0, 1.0, 1.0, 1.0 });
+ wlr_renderer_end(backend->renderer);
struct wl_event_loop *ev = wl_display_get_event_loop(backend->display);
output->frame_timer = wl_event_loop_add_timer(ev, signal_frame, output);