mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-19 06:59:48 -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
|
|
@ -150,16 +150,13 @@ const struct wlr_gles2_pixel_format *get_gles2_format_from_gl(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
const uint32_t *get_gles2_shm_formats(const struct wlr_gles2_renderer *renderer,
|
||||
size_t *len) {
|
||||
static uint32_t shm_formats[sizeof(formats) / sizeof(formats[0])];
|
||||
size_t j = 0;
|
||||
void get_gles2_shm_formats(const struct wlr_gles2_renderer *renderer,
|
||||
struct wlr_drm_format_set *out) {
|
||||
for (size_t i = 0; i < sizeof(formats) / sizeof(formats[0]); i++) {
|
||||
if (!is_gles2_pixel_format_supported(renderer, &formats[i])) {
|
||||
continue;
|
||||
}
|
||||
shm_formats[j++] = formats[i].drm_format;
|
||||
wlr_drm_format_set_add(out, formats[i].drm_format, DRM_FORMAT_MOD_INVALID);
|
||||
wlr_drm_format_set_add(out, formats[i].drm_format, DRM_FORMAT_MOD_LINEAR);
|
||||
}
|
||||
*len = j;
|
||||
return shm_formats;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue