[gimp] app: use gimp_tile_handler_validate_validate() in GimpProjection
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: use gimp_tile_handler_validate_validate() in GimpProjection
- Date: Wed, 28 Nov 2018 18:28:27 +0000 (UTC)
commit d6f0ca5531e73f8f002b41e700b71a166e5fe5ae
Author: Ell <ell_se yahoo com>
Date: Wed Nov 28 13:08:57 2018 -0500
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.
app/core/gimpprojection.c | 32 ++++++++++++++------------------
1 file changed, 14 insertions(+), 18 deletions(-)
---
diff --git a/app/core/gimpprojection.c b/app/core/gimpprojection.c
index a42aaea608..0baae20083 100644
--- a/app/core/gimpprojection.c
+++ b/app/core/gimpprojection.c
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]