[gimp/gimp-2-10] app: avoid starting the chunk renderer while finishing drawing a projection
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] app: avoid starting the chunk renderer while finishing drawing a projection
- Date: Wed, 28 Nov 2018 18:27:31 +0000 (UTC)
commit 18815512f2b1e45c43201c5b5c8178100a558d7e
Author: Ell <ell_se yahoo com>
Date: Wed Nov 28 12:59:10 2018 -0500
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.
(cherry picked from commit 8a47b6819439d16c140c40fbb14f95ad6ede0d3a)
app/core/gimpprojection.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index b416846809..f6d572b6a5 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -184,7 +184,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);
@@ -603,7 +604,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);
}
}
@@ -898,11 +899,12 @@ gimp_projection_chunk_render_init (GimpProjection *proj)
chunk_render->target_n_pixels = GIMP_PROJECTION_CHUNK_WIDTH *
GIMP_PROJECTION_CHUNK_HEIGHT;
- 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;
@@ -928,7 +930,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;
@@ -1036,7 +1038,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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]