memorytexture: Export less private API

It's not needed anymore with GdkTextureDownloader now.
This commit is contained in:
Benjamin Otte
2023-02-14 07:45:52 +01:00
parent 774696011d
commit cca5de3c7f
3 changed files with 6 additions and 18 deletions

View File

@@ -233,21 +233,11 @@ gdk_memory_texture_from_texture (GdkTexture *texture,
return GDK_MEMORY_TEXTURE (result);
}
const guchar *
gdk_memory_texture_get_data (GdkMemoryTexture *self)
{
return g_bytes_get_data (self->bytes, NULL);
}
GBytes *
gdk_memory_texture_get_bytes (GdkMemoryTexture *self)
gdk_memory_texture_get_bytes (GdkMemoryTexture *self,
gsize *out_stride)
{
*out_stride = self->stride;
return self->bytes;
}
gsize
gdk_memory_texture_get_stride (GdkMemoryTexture *self)
{
return self->stride;
}

View File

@@ -37,9 +37,8 @@ GdkTexture * gdk_memory_texture_new_subtexture (GdkMemoryTexture *
int width,
int height);
const guchar * gdk_memory_texture_get_data (GdkMemoryTexture *self);
GBytes * gdk_memory_texture_get_bytes (GdkMemoryTexture *self);
gsize gdk_memory_texture_get_stride (GdkMemoryTexture *self);
GBytes * gdk_memory_texture_get_bytes (GdkMemoryTexture *self,
gsize *out_stride);
G_END_DECLS

View File

@@ -254,8 +254,7 @@ gdk_texture_downloader_download_bytes (const GdkTextureDownloader *self,
{
GdkMemoryTexture *memtex = GDK_MEMORY_TEXTURE (self->texture);
*out_stride = gdk_memory_texture_get_stride (memtex);
return g_bytes_ref (gdk_memory_texture_get_bytes (memtex));
return g_bytes_ref (gdk_memory_texture_get_bytes (memtex, out_stride));
}
stride = self->texture->width * gdk_memory_format_bytes_per_pixel (self->format);