mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-08 17:50:10 +00:00
11543a229a
... and plumb the color state through the downloading machinery, where no matter what path it takes it ends up in gdk_memory_convert_color_state() or gdk_memory_convert(). The 2nd of those has been expanded to optionally do colorstate conversion when the 2 colorstates are different.
50 lines
1.4 KiB
C
50 lines
1.4 KiB
C
#include "config.h"
|
|
|
|
#include "gdkdmabufdownloaderprivate.h"
|
|
|
|
G_DEFINE_INTERFACE (GdkDmabufDownloader, gdk_dmabuf_downloader, G_TYPE_OBJECT)
|
|
|
|
static void
|
|
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,
|
|
GError **error)
|
|
{
|
|
GdkDmabufDownloaderInterface *iface;
|
|
|
|
g_return_val_if_fail (GDK_IS_DMABUF_DOWNLOADER (self), FALSE);
|
|
|
|
iface = GDK_DMABUF_DOWNLOADER_GET_IFACE (self);
|
|
return iface->supports (self, texture, error);
|
|
}
|
|
|
|
void
|
|
gdk_dmabuf_downloader_download (GdkDmabufDownloader *self,
|
|
GdkDmabufTexture *texture,
|
|
GdkMemoryFormat format,
|
|
GdkColorState *color_state,
|
|
guchar *data,
|
|
gsize stride)
|
|
{
|
|
GdkDmabufDownloaderInterface *iface;
|
|
|
|
g_return_if_fail (GDK_IS_DMABUF_DOWNLOADER (self));
|
|
|
|
iface = GDK_DMABUF_DOWNLOADER_GET_IFACE (self);
|
|
iface->download (self, texture, format, color_state, data, stride);
|
|
}
|
|
|