app: use gimp_tile_handler_validate_validate() in GimpProjection

Use gimp_tile_handler_validate_validate(), added in the last
commit, in GimpProjection, in order to render the projection,
instead of separately invalidating the buffer, undoing the
invalidation, and then rendering the graph.  This is more
efficient, and more idiomatic.
This commit is contained in:
Ell 2018-11-28 13:08:57 -05:00
parent 82a60997d4
commit d6f0ca5531
1 changed files with 14 additions and 18 deletions

View File

@ -736,16 +736,12 @@ gimp_projection_free_buffer (GimpProjection *proj)
if (proj->priv->buffer)
{
if (proj->priv->validate_handler)
{
gimp_tile_handler_validate_unassign (proj->priv->validate_handler,
proj->priv->buffer);
}
gimp_tile_handler_validate_unassign (proj->priv->validate_handler,
proj->priv->buffer);
g_clear_object (&proj->priv->buffer);
g_clear_object (&proj->priv->validate_handler);
}
g_clear_object (&proj->priv->validate_handler);
}
static void
@ -1154,19 +1150,19 @@ gimp_projection_paint_area (GimpProjection *proj,
0, 0, width, height,
&x, &y, &w, &h))
{
if (proj->priv->validate_handler)
gimp_tile_handler_validate_invalidate (proj->priv->validate_handler,
GEGL_RECTANGLE (x, y, w, h));
if (now)
{
GeglNode *graph = gimp_projectable_get_graph (proj->priv->projectable);
if (proj->priv->validate_handler)
gimp_tile_handler_validate_undo_invalidate (proj->priv->validate_handler,
GEGL_RECTANGLE (x, y, w, h));
gegl_node_blit_buffer (graph, proj->priv->buffer,
GEGL_RECTANGLE (x, y, w, h), 0, GEGL_ABYSS_NONE);
gimp_tile_handler_validate_validate (
proj->priv->validate_handler,
proj->priv->buffer,
GEGL_RECTANGLE (x, y, w, h),
FALSE);
}
else
{
gimp_tile_handler_validate_invalidate (
proj->priv->validate_handler,
GEGL_RECTANGLE (x, y, w, h));
}
/* add the projectable's offsets because the list of update areas