gegl/buffer: move some conditionals out of hot-spot fast path for 1x1 fetch

As well as making some related static functions inlineable.
parent efea6460
......@@ -1868,17 +1868,12 @@ _gegl_buffer_get_unlocked (GeglBuffer *buffer,
gint rowstride,
GeglAbyssPolicy repeat_mode)
{
g_return_if_fail (scale > 0.0);
if (format == NULL)
format = buffer->soft_format;
if (gegl_cl_is_accelerated ())
{
gegl_buffer_cl_cache_flush (buffer, rect);
}
if (GEGL_FLOAT_EQUAL (scale, 1.0) &&
if (scale == 1.0 &&
rect &&
rect->width == 1)
{
......@@ -1891,7 +1886,7 @@ _gegl_buffer_get_unlocked (GeglBuffer *buffer,
else
{
gint bpp = babl_format_get_bytes_per_pixel (buffer->soft_format);
if (buffer->soft_format == format || rowstride != bpp)
if (!format || buffer->soft_format == format || rowstride != bpp)
{
gegl_buffer_iterate_read_dispatch (buffer, rect, dest_buf,
rowstride, format, 0, repeat_mode);
......@@ -1910,6 +1905,11 @@ _gegl_buffer_get_unlocked (GeglBuffer *buffer,
}
}
if (format == NULL)
format = buffer->soft_format;
g_return_if_fail (scale > 0.0);
if (!rect && GEGL_FLOAT_EQUAL (scale, 1.0))
{
gegl_buffer_iterate_read_dispatch (buffer, &buffer->extent, dest_buf,
......
......@@ -101,7 +101,7 @@ void gegl_tile_unref (GeglTile *tile)
g_slice_free (GeglTile, tile);
}
static GeglTile *
static inline GeglTile *
gegl_tile_new_bare_internal (void)
{
GeglTile *tile = g_slice_new0 (GeglTile);
......@@ -173,7 +173,7 @@ gegl_tile_new (gint size)
return tile;
}
static void
static inline void
gegl_tile_unclone (GeglTile *tile)
{
if (*gegl_tile_n_clones (tile) > 1)
......@@ -277,7 +277,7 @@ gegl_tile_lock (GeglTile *tile)
}
}
static void
static inline void
_gegl_tile_void_pyramid (GeglTileSource *source,
gint x,
gint y,
......@@ -289,7 +289,7 @@ _gegl_tile_void_pyramid (GeglTileSource *source,
_gegl_tile_void_pyramid (source, x/2, y/2, z+1);
}
static void
static inline void
gegl_tile_void_pyramid (GeglTile *tile)
{
if (tile->tile_storage &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment