mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-30 00:15:58 +01:00
Merge pull request #594 from Ongy/drm-surface-buffers
relases gbm buffers on init
This commit is contained in:
commit
f152fdb4c5
1 changed files with 15 additions and 0 deletions
|
@ -66,6 +66,21 @@ bool wlr_drm_surface_init(struct wlr_drm_surface *surf,
|
||||||
surf->width = width;
|
surf->width = width;
|
||||||
surf->height = height;
|
surf->height = height;
|
||||||
|
|
||||||
|
if (surf->gbm) {
|
||||||
|
if (surf->front) {
|
||||||
|
gbm_surface_release_buffer(surf->gbm, surf->front);
|
||||||
|
surf->front = NULL;
|
||||||
|
}
|
||||||
|
if (surf->back) {
|
||||||
|
gbm_surface_release_buffer(surf->gbm, surf->back);
|
||||||
|
surf->back = NULL;
|
||||||
|
}
|
||||||
|
gbm_surface_destroy(surf->gbm);
|
||||||
|
}
|
||||||
|
if (surf->egl) {
|
||||||
|
eglDestroySurface(surf->renderer->egl.display, surf->egl);
|
||||||
|
}
|
||||||
|
|
||||||
surf->gbm = gbm_surface_create(renderer->gbm, width, height,
|
surf->gbm = gbm_surface_create(renderer->gbm, width, height,
|
||||||
format, GBM_BO_USE_RENDERING | flags);
|
format, GBM_BO_USE_RENDERING | flags);
|
||||||
if (!surf->gbm) {
|
if (!surf->gbm) {
|
||||||
|
|
Loading…
Reference in a new issue