diff options
author | Simon Ser <contact@emersion.fr> | 2021-10-01 17:22:04 +0200 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-10-01 09:26:05 -0600 |
commit | 323b8498ad42c94cb8fe6e93a633ef093a53b081 (patch) | |
tree | 0ad3b1af10ba28d7c6a5613c52bc126328eb8a63 /render | |
parent | 1d7e438d8ac636a2c90d58875e73a67e5440e4ae (diff) |
Revert "render/drm_format_set: add wlr_drm_format_has"
This reverts commit 833437d5921339f2862ccfb0493617630ea3937d.
Diffstat (limited to 'render')
-rw-r--r-- | render/drm_format_set.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/render/drm_format_set.c b/render/drm_format_set.c index daded20b..bd8f0cb7 100644 --- a/render/drm_format_set.c +++ b/render/drm_format_set.c @@ -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,8 +113,10 @@ bool wlr_drm_format_add(struct wlr_drm_format **fmt_ptr, uint64_t modifier) { return true; } - if (wlr_drm_format_has(fmt, modifier)) { - return true; + for (size_t i = 0; i < fmt->len; ++i) { + if (fmt->modifiers[i] == modifier) { + return true; + } } if (fmt->len == fmt->cap) { |