aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-06-08 19:54:11 -0400
committerDrew DeVault <sir@cmpwn.com>2018-06-08 19:54:11 -0400
commit7f3ad497eb2a68f1c4b41843df6d9f669c7e1f10 (patch)
tree3a542e7211681f2bc6759f4344ef1efa8b4acaee
parent8770449eb7c84fe2fb1d59c2a6d63e8053178b7b (diff)
parent3e83f9d6b89f9b3a7af9761b4adffd173858e637 (diff)
Merge branch 'surface-fix-buffer-release'
-rw-r--r--types/wlr_surface.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/types/wlr_surface.c b/types/wlr_surface.c
index 9c3eb86d..fca4e847 100644
--- a/types/wlr_surface.c
+++ b/types/wlr_surface.c
@@ -394,6 +394,10 @@ static void surface_apply_damage(struct wlr_surface *surface,
}
wl_shm_buffer_end_access(buf);
+
+ // We've uploaded the wl_shm_buffer data to the GPU, we won't access the
+ // wl_buffer anymore
+ surface_state_release_buffer(surface->current);
} else if (invalid_buffer || reupload_buffer) {
wlr_texture_destroy(surface->texture);
@@ -409,9 +413,10 @@ static void surface_apply_damage(struct wlr_surface *surface,
surface->texture = NULL;
wlr_log(L_ERROR, "Unknown buffer handle attached");
}
- }
- surface_state_release_buffer(surface->current);
+ // Don't release the wl_buffer yet: since the texture is shared with the
+ // client, we'll access the wl_buffer when rendering
+ }
}
static void surface_commit_pending(struct wlr_surface *surface) {