Commit 8a47b681 authored by Ell's avatar Ell

app: avoid starting the chunk renderer while finishing drawing a projection

In gimp_projection_finish_draw(), make sure we don't accidentally
re-start the chunk renderer idle source while running the remaining
iterations, in case the chunk height changes, and we need to reinit
the renderer state.
parent b07f8102
......@@ -185,7 +185,8 @@ static void gimp_projection_chunk_render_start (GimpProjection *proj)
static void gimp_projection_chunk_render_stop (GimpProjection *proj);
static gboolean gimp_projection_chunk_render_callback (gpointer data);
static void gimp_projection_chunk_render_init (GimpProjection *proj);
static void gimp_projection_chunk_render_reinit (GimpProjection *proj);
static void gimp_projection_chunk_render_reinit (GimpProjection *proj,
gboolean assume_running);
static gboolean gimp_projection_chunk_render_iteration(GimpProjection *proj,
gboolean chunk);
static gboolean gimp_projection_chunk_render_next_area(GimpProjection *proj);
......@@ -613,7 +614,7 @@ gimp_projection_set_priority_rect (GimpProjection *proj,
proj->priv->priority_rect = rect;
if (proj->priv->chunk_render.idle_id)
gimp_projection_chunk_render_reinit (proj);
gimp_projection_chunk_render_reinit (proj, FALSE);
......@@ -909,11 +910,12 @@ gimp_projection_chunk_render_init (GimpProjection *proj)
chunk_render->target_n_pixels = GIMP_PROJECTION_CHUNK_WIDTH *
gimp_projection_chunk_render_reinit (proj);
gimp_projection_chunk_render_reinit (proj, FALSE);
static void
gimp_projection_chunk_render_reinit (GimpProjection *proj)
gimp_projection_chunk_render_reinit (GimpProjection *proj,
gboolean assume_running)
GimpProjectionChunkRender *chunk_render = &proj->priv->chunk_render;
......@@ -939,7 +941,7 @@ gimp_projection_chunk_render_reinit (GimpProjection *proj)
* its unrendered area with the update_areas list, and make it start
* work on the next unrendered area in the list.
if (chunk_render->idle_id)
if (chunk_render->idle_id || assume_running)
cairo_rectangle_int_t rect;
gint work_h = 0;
......@@ -1047,7 +1049,7 @@ gimp_projection_chunk_render_iteration (GimpProjection *proj,
* current area, so that we're back at the beginning of a row
if (work_x != chunk_render->x)
gimp_projection_chunk_render_reinit (proj);
gimp_projection_chunk_render_reinit (proj, TRUE);
chunk_render->work_height = work_h;
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