buffer: fix hot tile code that got clobbered in a revert commit

parent 16ea30a8
...@@ -127,16 +127,18 @@ gegl_buffer_get_pixel (GeglBuffer *buffer, ...@@ -127,16 +127,18 @@ gegl_buffer_get_pixel (GeglBuffer *buffer,
gint indice_x = gegl_tile_indice (tiledx, tile_width); gint indice_x = gegl_tile_indice (tiledx, tile_width);
gint indice_y = gegl_tile_indice (tiledy, tile_height); gint indice_y = gegl_tile_indice (tiledy, tile_height);
GeglTile *tile = NULL; GeglTile *tile = buffer->tile_storage->hot_tile;
const Babl *fish = NULL; const Babl *fish = NULL;
if (!(tile && if (!(tile &&
tile->x == indice_x && tile->x == indice_x &&
tile->y == indice_y)) tile->y == indice_y))
{ {
_gegl_buffer_drop_hot_tile (buffer);
tile = gegl_tile_source_get_tile ((GeglTileSource *) (buffer), tile = gegl_tile_source_get_tile ((GeglTileSource *) (buffer),
indice_x, indice_y, indice_x, indice_y,
0); 0);
buffer->tile_storage->hot_tile = tile;
} }
if (tile) if (tile)
...@@ -160,7 +162,6 @@ gegl_buffer_get_pixel (GeglBuffer *buffer, ...@@ -160,7 +162,6 @@ gegl_buffer_get_pixel (GeglBuffer *buffer,
tp = gegl_tile_get_data (tile) + (offsety * tile_width + offsetx) * px_size; tp = gegl_tile_get_data (tile) + (offsety * tile_width + offsetx) * px_size;
memcpy (buf, tp, px_size); memcpy (buf, tp, px_size);
} }
gegl_tile_unref (tile);
} }
} }
......
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