mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
dmabuf: Init the dmabuf subsystem before creating texture
We did not do that, so when the dmabuf building looked at the list of downloaders, it was empty and the result was an error. That's not good.
This commit is contained in:
parent
7325121c63
commit
612b5416af
@ -1866,12 +1866,12 @@ gdk_display_add_dmabuf_downloader (GdkDisplay *display,
|
|||||||
* using the relevant EGL extensions, and download it into a memory
|
* using the relevant EGL extensions, and download it into a memory
|
||||||
* texture, possibly doing format conversion with shaders (in GSK).
|
* texture, possibly doing format conversion with shaders (in GSK).
|
||||||
*/
|
*/
|
||||||
static void
|
void
|
||||||
init_dmabuf_formats (GdkDisplay *display)
|
gdk_display_init_dmabuf (GdkDisplay *self)
|
||||||
{
|
{
|
||||||
GdkDmabufFormatsBuilder *builder;
|
GdkDmabufFormatsBuilder *builder;
|
||||||
|
|
||||||
if (display->dmabuf_formats != NULL)
|
if (self->dmabuf_formats != NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
builder = gdk_dmabuf_formats_builder_new ();
|
builder = gdk_dmabuf_formats_builder_new ();
|
||||||
@ -1879,13 +1879,13 @@ init_dmabuf_formats (GdkDisplay *display)
|
|||||||
#ifdef HAVE_LINUX_DMA_BUF_H
|
#ifdef HAVE_LINUX_DMA_BUF_H
|
||||||
if (!GDK_DEBUG_CHECK (DMABUF_DISABLE))
|
if (!GDK_DEBUG_CHECK (DMABUF_DISABLE))
|
||||||
{
|
{
|
||||||
gdk_display_prepare_gl (display, NULL);
|
gdk_display_prepare_gl (self, NULL);
|
||||||
|
|
||||||
gdk_display_add_dmabuf_downloader (display, gdk_dmabuf_get_direct_downloader (), builder);
|
gdk_display_add_dmabuf_downloader (self, gdk_dmabuf_get_direct_downloader (), builder);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
display->dmabuf_formats = gdk_dmabuf_formats_builder_free_to_formats (builder);
|
self->dmabuf_formats = gdk_dmabuf_formats_builder_free_to_formats (builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1904,7 +1904,7 @@ init_dmabuf_formats (GdkDisplay *display)
|
|||||||
GdkDmabufFormats *
|
GdkDmabufFormats *
|
||||||
gdk_display_get_dmabuf_formats (GdkDisplay *display)
|
gdk_display_get_dmabuf_formats (GdkDisplay *display)
|
||||||
{
|
{
|
||||||
init_dmabuf_formats (display);
|
gdk_display_init_dmabuf (display);
|
||||||
|
|
||||||
return display->dmabuf_formats;
|
return display->dmabuf_formats;
|
||||||
}
|
}
|
||||||
|
@ -211,6 +211,8 @@ gulong _gdk_display_get_next_serial (GdkDisplay *display
|
|||||||
void _gdk_display_pause_events (GdkDisplay *display);
|
void _gdk_display_pause_events (GdkDisplay *display);
|
||||||
void _gdk_display_unpause_events (GdkDisplay *display);
|
void _gdk_display_unpause_events (GdkDisplay *display);
|
||||||
|
|
||||||
|
void gdk_display_init_dmabuf (GdkDisplay *self);
|
||||||
|
|
||||||
GdkVulkanContext * gdk_display_create_vulkan_context (GdkDisplay *self,
|
GdkVulkanContext * gdk_display_create_vulkan_context (GdkDisplay *self,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
@ -140,6 +140,8 @@ gdk_dmabuf_texture_new_from_builder (GdkDmabufTextureBuilder *builder,
|
|||||||
display = gdk_dmabuf_texture_builder_get_display (builder);
|
display = gdk_dmabuf_texture_builder_get_display (builder);
|
||||||
dmabuf = gdk_dmabuf_texture_builder_get_dmabuf (builder);
|
dmabuf = gdk_dmabuf_texture_builder_get_dmabuf (builder);
|
||||||
|
|
||||||
|
gdk_display_init_dmabuf (display);
|
||||||
|
|
||||||
for (i = 0; display->dmabuf_downloaders[i] != NULL; i++)
|
for (i = 0; display->dmabuf_downloaders[i] != NULL; i++)
|
||||||
{
|
{
|
||||||
if (local_error && g_error_matches (local_error, GDK_DMABUF_ERROR, GDK_DMABUF_ERROR_UNSUPPORTED_FORMAT))
|
if (local_error && g_error_matches (local_error, GDK_DMABUF_ERROR, GDK_DMABUF_ERROR_UNSUPPORTED_FORMAT))
|
||||||
|
Loading…
Reference in New Issue
Block a user