mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 14:15:58 +01:00
Revert "render/drm_format_set: add wlr_drm_format_has"
This reverts commit 833437d592
.
This commit is contained in:
parent
1d7e438d8a
commit
323b8498ad
2 changed files with 11 additions and 13 deletions
|
@ -4,7 +4,6 @@
|
|||
#include <wlr/render/drm_format_set.h>
|
||||
|
||||
struct wlr_drm_format *wlr_drm_format_create(uint32_t format);
|
||||
bool wlr_drm_format_has(const struct wlr_drm_format *fmt, uint64_t modifier);
|
||||
bool wlr_drm_format_add(struct wlr_drm_format **fmt_ptr, uint64_t modifier);
|
||||
struct wlr_drm_format *wlr_drm_format_dup(const struct wlr_drm_format *format);
|
||||
/**
|
||||
|
|
|
@ -48,7 +48,13 @@ bool wlr_drm_format_set_has(const struct wlr_drm_format_set *set,
|
|||
return true;
|
||||
}
|
||||
|
||||
return wlr_drm_format_has(fmt, modifier);
|
||||
for (size_t i = 0; i < fmt->len; ++i) {
|
||||
if (fmt->modifiers[i] == modifier) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wlr_drm_format_set_add(struct wlr_drm_format_set *set, uint32_t format,
|
||||
|
@ -100,15 +106,6 @@ struct wlr_drm_format *wlr_drm_format_create(uint32_t format) {
|
|||
return fmt;
|
||||
}
|
||||
|
||||
bool wlr_drm_format_has(const struct wlr_drm_format *fmt, uint64_t modifier) {
|
||||
for (size_t i = 0; i < fmt->len; ++i) {
|
||||
if (fmt->modifiers[i] == modifier) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool wlr_drm_format_add(struct wlr_drm_format **fmt_ptr, uint64_t modifier) {
|
||||
struct wlr_drm_format *fmt = *fmt_ptr;
|
||||
|
||||
|
@ -116,9 +113,11 @@ bool wlr_drm_format_add(struct wlr_drm_format **fmt_ptr, uint64_t modifier) {
|
|||
return true;
|
||||
}
|
||||
|
||||
if (wlr_drm_format_has(fmt, modifier)) {
|
||||
for (size_t i = 0; i < fmt->len; ++i) {
|
||||
if (fmt->modifiers[i] == modifier) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (fmt->len == fmt->cap) {
|
||||
size_t cap = fmt->cap ? fmt->cap * 2 : 4;
|
||||
|
|
Loading…
Reference in a new issue