Commit e1e4ba9c authored by Ell's avatar Ell

app: in GimpTileHandlerValidate, clear data when allocating tile

In GimpTileHandlerValidate, when allocating a new tile upon a
TILE_GET command, but not rendering the whole tile, clear the tile
data before rendering, so that the unrendered regions of the tile
contain zeros, rather than junk.
parent 1a0185f7
......@@ -260,15 +260,20 @@ gimp_tile_handler_validate_validate (GeglTileSource *source,
gint n_rects;
gint i;
if (! tile)
tile = gegl_tile_handler_create_tile (GEGL_TILE_HANDLER (source),
x, y, 0);
cairo_region_subtract_rectangle (validate->dirty_region, &tile_rect);
tile_bpp = babl_format_get_bytes_per_pixel (validate->format);
tile_stride = tile_bpp * validate->tile_width;
if (! tile)
{
tile = gegl_tile_handler_create_tile (GEGL_TILE_HANDLER (source),
x, y, 0);
memset (gegl_tile_get_data (tile),
0, tile_stride * validate->tile_height);
}
gegl_tile_lock (tile);
n_rects = cairo_region_num_rectangles (tile_region);
......
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