memorytexture: Export less private API
authorBenjamin Otte <otte@redhat.com>
Tue, 14 Feb 2023 06:45:52 +0000 (07:45 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 14 Feb 2023 23:39:18 +0000 (00:39 +0100)
It's not needed anymore with GdkTextureDownloader now.

gdk/gdkmemorytexture.c
gdk/gdkmemorytextureprivate.h
gdk/gdktexturedownloader.c

index 6f9967dcfb2c6598beccc2b4e26531498beee90c..641386b786fb40f7327a54fef0b31aa75c85a46f 100644 (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;
-}
-
index 7e4092b77c4659b32dfd6a238f2f311be92442e5..f182f7fbd9684805af0d33496fc0f67dfc3fc9e1 100644 (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
index f45a6aceb70d0aac304eb26a9d902a650112af99..4a948dc40a4b13b82a4e364534f7f8c567de35fe 100644 (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);