mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
render: rename wlr_renderer_get_dmabuf_formats
Rename wlr_renderer_get_dmabuf_formats to wlr_renderer_get_dmabuf_texture_formats. This makes it clear the formats are only suitable for creating wlr_textures.
This commit is contained in:
parent
c045253927
commit
49115e9d5d
7 changed files with 23 additions and 19 deletions
19
render/egl.c
19
render/egl.c
|
|
@ -157,13 +157,15 @@ static void init_dmabuf_formats(struct wlr_egl *egl) {
|
|||
}
|
||||
|
||||
if (modifiers_len == 0) {
|
||||
wlr_drm_format_set_add(&egl->dmabuf_formats, fmt, DRM_FORMAT_MOD_INVALID);
|
||||
wlr_drm_format_set_add(&egl->dmabuf_texture_formats, fmt,
|
||||
DRM_FORMAT_MOD_INVALID);
|
||||
wlr_drm_format_set_add(&egl->dmabuf_render_formats, fmt,
|
||||
DRM_FORMAT_MOD_INVALID);
|
||||
}
|
||||
|
||||
for (int j = 0; j < modifiers_len; j++) {
|
||||
wlr_drm_format_set_add(&egl->dmabuf_formats, fmt, modifiers[j]);
|
||||
wlr_drm_format_set_add(&egl->dmabuf_texture_formats, fmt,
|
||||
modifiers[j]);
|
||||
if (!external_only[j]) {
|
||||
wlr_drm_format_set_add(&egl->dmabuf_render_formats, fmt,
|
||||
modifiers[j]);
|
||||
|
|
@ -398,13 +400,13 @@ void wlr_egl_finish(struct wlr_egl *egl) {
|
|||
return;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < egl->dmabuf_formats.len; i++) {
|
||||
for (size_t i = 0; i < egl->dmabuf_texture_formats.len; i++) {
|
||||
free(egl->external_only_dmabuf_formats[i]);
|
||||
}
|
||||
free(egl->external_only_dmabuf_formats);
|
||||
|
||||
wlr_drm_format_set_finish(&egl->dmabuf_render_formats);
|
||||
wlr_drm_format_set_finish(&egl->dmabuf_formats);
|
||||
wlr_drm_format_set_finish(&egl->dmabuf_texture_formats);
|
||||
|
||||
eglMakeCurrent(egl->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||
if (egl->wl_display) {
|
||||
|
|
@ -605,8 +607,8 @@ EGLImageKHR wlr_egl_create_image_from_wl_drm(struct wlr_egl *egl,
|
|||
|
||||
static bool dmabuf_format_is_external_only(struct wlr_egl *egl,
|
||||
uint32_t format, uint64_t modifier) {
|
||||
for (size_t i = 0; i < egl->dmabuf_formats.len; i++) {
|
||||
struct wlr_drm_format *fmt = egl->dmabuf_formats.formats[i];
|
||||
for (size_t i = 0; i < egl->dmabuf_texture_formats.len; i++) {
|
||||
struct wlr_drm_format *fmt = egl->dmabuf_texture_formats.formats[i];
|
||||
if (fmt->format == format) {
|
||||
if (egl->external_only_dmabuf_formats[i] == NULL) {
|
||||
break;
|
||||
|
|
@ -812,8 +814,9 @@ static int get_egl_dmabuf_modifiers(struct wlr_egl *egl, int format,
|
|||
return num;
|
||||
}
|
||||
|
||||
const struct wlr_drm_format_set *wlr_egl_get_dmabuf_formats(struct wlr_egl *egl) {
|
||||
return &egl->dmabuf_formats;
|
||||
const struct wlr_drm_format_set *wlr_egl_get_dmabuf_texture_formats(
|
||||
struct wlr_egl *egl) {
|
||||
return &egl->dmabuf_texture_formats;
|
||||
}
|
||||
|
||||
const struct wlr_drm_format_set *wlr_egl_get_dmabuf_render_formats(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue