[gimp] app: use actual render area when processing display filters



commit a5a2b56850f10ab15b4b5618f508ea2068fc3f90
Author: Ell <ell_se yahoo com>
Date:   Thu Nov 2 13:33:52 2017 -0400

    app: use actual render area when processing display filters
    
    When processing display filters, shift the filter buffer to the
    top-left corner of the render area, and pass the actual render
    area, instead of an area whose top-left coords are (0, 0), to the
    display filter.  This allows for position-dependent display
    filters.

 app/display/gimpdisplayshell-render.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c
index 399aa37..cb36652 100644
--- a/app/display/gimpdisplayshell-render.c
+++ b/app/display/gimpdisplayshell-render.c
@@ -274,13 +274,23 @@ gimp_display_shell_render (GimpDisplayShell *shell,
 
       if (gimp_display_shell_has_filter (shell))
         {
+          GeglBuffer *filter_buffer;
+
+          filter_buffer = g_object_new (GEGL_TYPE_BUFFER,
+                                        "source", shell->filter_buffer,
+                                        "shift-x", -scaled_x,
+                                        "shift-y", -scaled_y,
+                                        NULL);
+
           /*  convert the filter_buffer in place
            */
           gimp_color_display_stack_convert_buffer (shell->filter_stack,
-                                                   shell->filter_buffer,
-                                                   GEGL_RECTANGLE (0, 0,
+                                                   filter_buffer,
+                                                   GEGL_RECTANGLE (scaled_x, scaled_y,
                                                                    scaled_width,
                                                                    scaled_height));
+
+          g_object_unref (filter_buffer);
         }
 
       if (gimp_display_shell_has_filter (shell) || ! can_convert_to_u8)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]