mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-25 21:21:21 +00:00
dmabufdownloader: Add a close() function
We need to unrealize renderers before unreffing them. This vfunc takes care of that.
This commit is contained in:
parent
ce04dfad41
commit
74620ffc46
@ -395,7 +395,13 @@ gdk_display_dispose (GObject *object)
|
||||
gsize i;
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (display->dmabuf_downloaders); i++)
|
||||
{
|
||||
if (display->dmabuf_downloaders[i] == NULL)
|
||||
continue;
|
||||
|
||||
gdk_dmabuf_downloader_close (display->dmabuf_downloaders[i]);
|
||||
g_clear_object (&display->dmabuf_downloaders[i]);
|
||||
}
|
||||
|
||||
_gdk_display_manager_remove_display (gdk_display_manager_get (), display);
|
||||
|
||||
|
@ -9,6 +9,15 @@ gdk_dmabuf_downloader_default_init (GdkDmabufDownloaderInterface *iface)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
gdk_dmabuf_downloader_close (GdkDmabufDownloader *self)
|
||||
{
|
||||
GdkDmabufDownloaderInterface *iface;
|
||||
|
||||
iface = GDK_DMABUF_DOWNLOADER_GET_IFACE (self);
|
||||
iface->close (self);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_dmabuf_downloader_supports (GdkDmabufDownloader *self,
|
||||
GdkDmabufTexture *texture,
|
||||
|
@ -13,6 +13,7 @@ struct _GdkDmabufDownloaderInterface
|
||||
{
|
||||
GTypeInterface g_iface;
|
||||
|
||||
void (* close) (GdkDmabufDownloader *downloader);
|
||||
gboolean (* supports) (GdkDmabufDownloader *downloader,
|
||||
GdkDmabufTexture *texture,
|
||||
GError **error);
|
||||
@ -23,6 +24,7 @@ struct _GdkDmabufDownloaderInterface
|
||||
gsize stride);
|
||||
};
|
||||
|
||||
void gdk_dmabuf_downloader_close (GdkDmabufDownloader *downloader);
|
||||
gboolean gdk_dmabuf_downloader_supports (GdkDmabufDownloader *downloader,
|
||||
GdkDmabufTexture *texture,
|
||||
GError **error);
|
||||
|
@ -127,9 +127,16 @@ gsk_gl_renderer_dmabuf_downloader_download (GdkDmabufDownloader *downloader_,
|
||||
gdk_gl_context_clear_current ();
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_gl_renderer_dmabuf_downloader_close (GdkDmabufDownloader *downloader)
|
||||
{
|
||||
gsk_renderer_unrealize (GSK_RENDERER (downloader));
|
||||
}
|
||||
|
||||
static void
|
||||
gsk_gl_renderer_dmabuf_downloader_init (GdkDmabufDownloaderInterface *iface)
|
||||
{
|
||||
iface->close = gsk_gl_renderer_dmabuf_downloader_close;
|
||||
iface->supports = gsk_gl_renderer_dmabuf_downloader_supports;
|
||||
iface->download = gsk_gl_renderer_dmabuf_downloader_download;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user