Commit d6f0ca55 authored by Ell's avatar Ell

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.
parent 82a60997
......@@ -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
......
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