mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-17 06:46:39 -04:00
render: swapchain: Add method to count free slots
This commit is contained in:
parent
cded7797f7
commit
1146650d71
2 changed files with 13 additions and 0 deletions
|
|
@ -120,3 +120,12 @@ bool wlr_swapchain_has_buffer(struct wlr_swapchain *swapchain,
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
int wlr_swapchain_count_free_slots(const struct wlr_swapchain *swapchain)
|
||||
{
|
||||
int count = 0;
|
||||
for (size_t i = 0; i < WLR_SWAPCHAIN_CAP; i++) {
|
||||
count += !swapchain->slots[i].acquired;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue