diff options
author | Drew DeVault <sir@cmpwn.com> | 2018-02-09 09:38:48 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-09 09:38:48 -0500 |
commit | 34489dca16ef9e7fd05c161b8b4f2fd5ce5e4ef0 (patch) | |
tree | 2a90beb98aacd85bbc5bd30df998b4e7c92ec3e7 /backend/drm/renderer.c | |
parent | 09c2626e32fd0eadc4b95a4f36b34f6bde79f6f4 (diff) | |
parent | cdd55b5d19470981ad71f8e6d31bd8152e44364b (diff) |
Merge pull request #571 from emersion/output-damage
Output damage tracking
Diffstat (limited to 'backend/drm/renderer.c')
-rw-r--r-- | backend/drm/renderer.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c index 350bfce4..0310a96a 100644 --- a/backend/drm/renderer.c +++ b/backend/drm/renderer.c @@ -128,9 +128,9 @@ void wlr_drm_surface_finish(struct wlr_drm_surface *surf) { memset(surf, 0, sizeof(*surf)); } -void wlr_drm_surface_make_current(struct wlr_drm_surface *surf) { - eglMakeCurrent(surf->renderer->egl.display, surf->egl, surf->egl, - surf->renderer->egl.context); +bool wlr_drm_surface_make_current(struct wlr_drm_surface *surf, + int *buffer_damage) { + return wlr_egl_make_current(&surf->renderer->egl, surf->egl, buffer_damage); } struct gbm_bo *wlr_drm_surface_swap_buffers(struct wlr_drm_surface *surf) { @@ -138,7 +138,9 @@ struct gbm_bo *wlr_drm_surface_swap_buffers(struct wlr_drm_surface *surf) { gbm_surface_release_buffer(surf->gbm, surf->front); } - eglSwapBuffers(surf->renderer->egl.display, surf->egl); + if (!eglSwapBuffers(surf->renderer->egl.display, surf->egl)) { + wlr_log(L_ERROR, "eglSwapBuffers failed"); + } surf->front = surf->back; surf->back = gbm_surface_lock_front_buffer(surf->gbm); @@ -150,7 +152,7 @@ struct gbm_bo *wlr_drm_surface_get_front(struct wlr_drm_surface *surf) { return surf->front; } - wlr_drm_surface_make_current(surf); + wlr_drm_surface_make_current(surf, NULL); glViewport(0, 0, surf->width, surf->height); glClearColor(0.0, 0.0, 0.0, 1.0); glClear(GL_COLOR_BUFFER_BIT); @@ -222,8 +224,9 @@ static struct wlr_texture *get_tex_for_bo(struct wlr_drm_renderer *renderer, str return tex->tex; } -struct gbm_bo *wlr_drm_surface_mgpu_copy(struct wlr_drm_surface *dest, struct gbm_bo *src) { - wlr_drm_surface_make_current(dest); +struct gbm_bo *wlr_drm_surface_mgpu_copy(struct wlr_drm_surface *dest, + struct gbm_bo *src) { + wlr_drm_surface_make_current(dest, NULL); struct wlr_texture *tex = get_tex_for_bo(dest->renderer, src); |