mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 14:00:09 +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;
|
gsize i;
|
||||||
|
|
||||||
for (i = 0; i < G_N_ELEMENTS (display->dmabuf_downloaders); 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]);
|
g_clear_object (&display->dmabuf_downloaders[i]);
|
||||||
|
}
|
||||||
|
|
||||||
_gdk_display_manager_remove_display (gdk_display_manager_get (), display);
|
_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
|
gboolean
|
||||||
gdk_dmabuf_downloader_supports (GdkDmabufDownloader *self,
|
gdk_dmabuf_downloader_supports (GdkDmabufDownloader *self,
|
||||||
GdkDmabufTexture *texture,
|
GdkDmabufTexture *texture,
|
||||||
|
@ -13,6 +13,7 @@ struct _GdkDmabufDownloaderInterface
|
|||||||
{
|
{
|
||||||
GTypeInterface g_iface;
|
GTypeInterface g_iface;
|
||||||
|
|
||||||
|
void (* close) (GdkDmabufDownloader *downloader);
|
||||||
gboolean (* supports) (GdkDmabufDownloader *downloader,
|
gboolean (* supports) (GdkDmabufDownloader *downloader,
|
||||||
GdkDmabufTexture *texture,
|
GdkDmabufTexture *texture,
|
||||||
GError **error);
|
GError **error);
|
||||||
@ -23,6 +24,7 @@ struct _GdkDmabufDownloaderInterface
|
|||||||
gsize stride);
|
gsize stride);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void gdk_dmabuf_downloader_close (GdkDmabufDownloader *downloader);
|
||||||
gboolean gdk_dmabuf_downloader_supports (GdkDmabufDownloader *downloader,
|
gboolean gdk_dmabuf_downloader_supports (GdkDmabufDownloader *downloader,
|
||||||
GdkDmabufTexture *texture,
|
GdkDmabufTexture *texture,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
@ -127,9 +127,16 @@ gsk_gl_renderer_dmabuf_downloader_download (GdkDmabufDownloader *downloader_,
|
|||||||
gdk_gl_context_clear_current ();
|
gdk_gl_context_clear_current ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gsk_gl_renderer_dmabuf_downloader_close (GdkDmabufDownloader *downloader)
|
||||||
|
{
|
||||||
|
gsk_renderer_unrealize (GSK_RENDERER (downloader));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gsk_gl_renderer_dmabuf_downloader_init (GdkDmabufDownloaderInterface *iface)
|
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->supports = gsk_gl_renderer_dmabuf_downloader_supports;
|
||||||
iface->download = gsk_gl_renderer_dmabuf_downloader_download;
|
iface->download = gsk_gl_renderer_dmabuf_downloader_download;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user