memorytexture: Use right size for GBytes

The GBytes were created with the wrong size.

Nobody seems to have looked at it.
This commit is contained in:
Benjamin Otte
2023-02-14 06:18:37 +01:00
parent 73f3ea9511
commit 01ff6c1c22

View File

@@ -222,7 +222,7 @@ gdk_memory_texture_from_texture (GdkTexture *texture,
data = g_malloc_n (stride, texture->height);
gdk_texture_do_download (texture, format, data, stride);
bytes = g_bytes_new_take (data, stride);
bytes = g_bytes_new_take (data, stride * texture->height);
result = gdk_memory_texture_new (texture->width,
texture->height,
format,
@@ -239,6 +239,12 @@ gdk_memory_texture_get_data (GdkMemoryTexture *self)
return g_bytes_get_data (self->bytes, NULL);
}
GBytes *
gdk_memory_texture_get_bytes (GdkMemoryTexture *self)
{
return self->bytes;
}
gsize
gdk_memory_texture_get_stride (GdkMemoryTexture *self)
{