mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-03-01 01:40:35 -05:00
render: unify getter for texture formats
Instead of having separate getters for shm formats and DMA-BUF formats, use the same pattern as wlr_output_impl.get_primary_formats with a single function which takes buffer caps as input.
This commit is contained in:
parent
c63275d75e
commit
85c1eda721
12 changed files with 78 additions and 67 deletions
|
|
@ -32,7 +32,7 @@
|
|||
void wlr_renderer_init(struct wlr_renderer *renderer,
|
||||
const struct wlr_renderer_impl *impl) {
|
||||
assert(impl->begin_buffer_pass);
|
||||
assert(impl->get_shm_texture_formats);
|
||||
assert(impl->get_texture_formats);
|
||||
assert(impl->get_render_buffer_caps);
|
||||
|
||||
*renderer = (struct wlr_renderer){
|
||||
|
|
@ -57,17 +57,14 @@ void wlr_renderer_destroy(struct wlr_renderer *r) {
|
|||
}
|
||||
}
|
||||
|
||||
const uint32_t *wlr_renderer_get_shm_texture_formats(struct wlr_renderer *r,
|
||||
size_t *len) {
|
||||
return r->impl->get_shm_texture_formats(r, len);
|
||||
const struct wlr_drm_format_set *wlr_renderer_get_texture_formats(
|
||||
struct wlr_renderer *r, uint32_t buffer_caps) {
|
||||
return r->impl->get_texture_formats(r, buffer_caps);
|
||||
}
|
||||
|
||||
const struct wlr_drm_format_set *wlr_renderer_get_dmabuf_texture_formats(
|
||||
struct wlr_renderer *r) {
|
||||
if (!r->impl->get_dmabuf_texture_formats) {
|
||||
return NULL;
|
||||
}
|
||||
return r->impl->get_dmabuf_texture_formats(r);
|
||||
return wlr_renderer_get_texture_formats(r, WLR_BUFFER_CAP_DMABUF);
|
||||
}
|
||||
|
||||
const struct wlr_drm_format_set *wlr_renderer_get_render_formats(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue