Commit 919ddce7 authored by Ell's avatar Ell

app: speed up layer-group preview rendering

In gimp_drawable_get_sub_preview_async(), when the drawable buffer
has a validate handler (i.e., when the drawable is a group layer),
validate the requested area before calling gegl_buffer_get(), so
that the buffer is validated in a single step, instead of tile-by-
parent faf6acfb
Pipeline #160791 failed with stages
in 28 minutes and 24 seconds
......@@ -327,11 +327,30 @@ static void
gimp_drawable_get_sub_preview_async_func (GimpAsync *async,
SubPreviewData *data)
GimpTempBuf *preview;
GimpTempBuf *preview;
GimpTileHandlerValidate *validate;
preview = gimp_temp_buf_new (data->rect.width, data->rect.height,
validate = gimp_tile_handler_validate_get_assigned (data->buffer);
if (validate)
GeglRectangle rect;
rect.x = floor (data->rect.x / data->scale);
rect.y = floor (data->rect.y / data->scale);
rect.width = ceil ((data->rect.x + data->rect.width) / data->scale) -
rect.height = ceil ((data->rect.x + data->rect.height) / data->scale) -
gimp_tile_handler_validate_validate (validate,
data->buffer, &rect,
gegl_buffer_get (data->buffer, &data->rect, data->scale,
gimp_temp_buf_get_format (preview),
gimp_temp_buf_get_data (preview),
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