[gegl] gegl/buffer: use buffer->soft_format where appropriate
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] gegl/buffer: use buffer->soft_format where appropriate
- Date: Wed, 27 Dec 2017 13:37:42 +0000 (UTC)
commit c196378e7f2318914eb60d2f109d9a96ad5c91e3
Author: Øyvind Kolås <pippin gimp org>
Date: Wed Dec 27 14:10:14 2017 +0100
gegl/buffer: use buffer->soft_format where appropriate
gegl/buffer/gegl-buffer-access.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-access.c b/gegl/buffer/gegl-buffer-access.c
index d3b4ef3..40b751c 100644
--- a/gegl/buffer/gegl-buffer-access.c
+++ b/gegl/buffer/gegl-buffer-access.c
@@ -1704,7 +1704,8 @@ _gegl_buffer_get_unlocked (GeglBuffer *buffer,
}
else
{
- if (buffer->format == format)
+ gint bpp = babl_format_get_bytes_per_pixel (buffer->soft_format);
+ if (buffer->soft_format == format)
{
gegl_buffer_iterate_read_dispatch (buffer, rect, dest_buf,
rowstride, format, 0, repeat_mode);
@@ -1712,11 +1713,11 @@ _gegl_buffer_get_unlocked (GeglBuffer *buffer,
else
{
/* first fetch all pixels to a temporary buffer */
- uint8_t tmp[rect->width * rect->height * 32];
+ uint8_t tmp[rect->width * rect->height * bpp];
gegl_buffer_iterate_read_dispatch (buffer, rect, &tmp[0],
- rowstride, buffer->format, 0, repeat_mode);
+ rowstride, buffer->soft_format, 0, repeat_mode);
/* then convert in a single shot */
- babl_process (babl_fish (buffer->format, format),
+ babl_process (babl_fish (buffer->soft_format, format),
&tmp[0], dest_buf, rect->height);
}
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]