dmabuf: Give downloaders a name

Add name to the downloader struct, and add it
to the debug spew for newly created dmabuf
textures.
This commit is contained in:
Matthias Clasen 2023-10-21 19:19:21 -04:00
parent 612e0e29f9
commit 9e3f537a15
3 changed files with 5 additions and 2 deletions

View File

@ -426,6 +426,7 @@ const GdkDmabufDownloader *
gdk_dmabuf_get_direct_downloader (void)
{
static const GdkDmabufDownloader downloader = {
"mmap",
gdk_dmabuf_direct_downloader_add_formats,
gdk_dmabuf_direct_downloader_supports,
gdk_dmabuf_direct_downloader_download,

View File

@ -21,6 +21,7 @@ struct _GdkDmabuf
struct _GdkDmabufDownloader
{
const char *name;
void (* add_formats) (const GdkDmabufDownloader *downloader,
GdkDisplay *display,
GdkDmabufFormatsBuilder *builder);

View File

@ -173,11 +173,12 @@ gdk_dmabuf_texture_new_from_builder (GdkDmabufTextureBuilder *builder,
}
GDK_DEBUG (DMABUF,
"Dmabuf texture in format %.4s:%#lx, %s%u planes, memory format %u",
"Dmabuf texture, format %.4s:%#lx, %s%u planes, memory format %u, downloader %s",
(char *) &dmabuf.fourcc, dmabuf.modifier,
gdk_dmabuf_texture_builder_get_premultiplied (builder) ? " premultiplied, " : "",
dmabuf.n_planes,
format);
format,
display->dmabuf_downloaders[i]->name);
self = g_object_new (GDK_TYPE_DMABUF_TEXTURE,
"width", width,