[gimp/soc-2011-seamless-clone2] app: remove "GeglRectangle visible" from gimp_image_map_apply()



commit 5cc11a2ff9491456f3f62e040145bb6e8d760f1b
Author: Michael Natterer <mitch gimp org>
Date:   Mon Apr 22 00:29:38 2013 +0200

    app: remove "GeglRectangle visible" from gimp_image_map_apply()
    
    because we now use a filter and the image projection updates
    the visible part only.

 app/core/gimpimagemap.c      |    3 +--
 app/core/gimpimagemap.h      |   20 ++++++++++----------
 app/tools/gimpcagetool.c     |   29 +----------------------------
 app/tools/gimpimagemaptool.c |   27 +--------------------------
 4 files changed, 13 insertions(+), 66 deletions(-)
---
diff --git a/app/core/gimpimagemap.c b/app/core/gimpimagemap.c
index dae6c15..16f14d9 100644
--- a/app/core/gimpimagemap.c
+++ b/app/core/gimpimagemap.c
@@ -259,8 +259,7 @@ gimp_image_map_new (GimpDrawable *drawable,
 }
 
 void
-gimp_image_map_apply (GimpImageMap        *image_map,
-                      const GeglRectangle *visible)
+gimp_image_map_apply (GimpImageMap *image_map)
 {
   GimpImage     *image;
   GimpChannel   *mask;
diff --git a/app/core/gimpimagemap.h b/app/core/gimpimagemap.h
index c4a1545..f0c61df 100644
--- a/app/core/gimpimagemap.h
+++ b/app/core/gimpimagemap.h
@@ -49,16 +49,16 @@ struct _GimpImageMapClass
 
 GType          gimp_image_map_get_type (void) G_GNUC_CONST;
 
-GimpImageMap * gimp_image_map_new      (GimpDrawable        *drawable,
-                                        const gchar         *undo_desc,
-                                        GeglNode            *operation,
-                                        const gchar         *stock_id);
-
-void           gimp_image_map_apply    (GimpImageMap        *image_map,
-                                        const GeglRectangle *visible);
-void           gimp_image_map_commit   (GimpImageMap        *image_map,
-                                        GimpProgress        *progress);
-void           gimp_image_map_abort    (GimpImageMap        *image_map);
+GimpImageMap * gimp_image_map_new      (GimpDrawable *drawable,
+                                        const gchar  *undo_desc,
+                                        GeglNode     *operation,
+                                        const gchar  *stock_id);
+
+void           gimp_image_map_apply    (GimpImageMap *image_map);
+
+void           gimp_image_map_commit   (GimpImageMap *image_map,
+                                        GimpProgress *progress);
+void           gimp_image_map_abort    (GimpImageMap *image_map);
 
 
 #endif /* __GIMP_IMAGE_MAP_H__ */
diff --git a/app/tools/gimpcagetool.c b/app/tools/gimpcagetool.c
index 1c1e8e3..4e80f64 100644
--- a/app/tools/gimpcagetool.c
+++ b/app/tools/gimpcagetool.c
@@ -48,8 +48,6 @@
 #include "widgets/gimphelp-ids.h"
 
 #include "display/gimpdisplay.h"
-#include "display/gimpdisplayshell.h"
-#include "display/gimpdisplayshell-transform.h"
 
 #include "gimpcagetool.h"
 #include "gimpcageoptions.h"
@@ -1262,30 +1260,5 @@ gimp_cage_tool_image_map_flush (GimpImageMap *image_map,
 static void
 gimp_cage_tool_image_map_update (GimpCageTool *ct)
 {
-  GimpTool         *tool  = GIMP_TOOL (ct);
-  GimpDisplayShell *shell = gimp_display_get_shell (tool->display);
-  GimpItem         *item  = GIMP_ITEM (tool->drawable);
-  gint              x, y;
-  gint              w, h;
-  gint              off_x, off_y;
-  GeglRectangle     visible;
-
-  gimp_display_shell_untransform_viewport (shell, &x, &y, &w, &h);
-
-  gimp_item_get_offset (item, &off_x, &off_y);
-
-  gimp_rectangle_intersect (x, y, w, h,
-                            off_x,
-                            off_y,
-                            gimp_item_get_width  (item),
-                            gimp_item_get_height (item),
-                            &visible.x,
-                            &visible.y,
-                            &visible.width,
-                            &visible.height);
-
-  visible.x -= off_x;
-  visible.y -= off_y;
-
-  gimp_image_map_apply (ct->image_map, &visible);
+  gimp_image_map_apply (ct->image_map);
 }
diff --git a/app/tools/gimpimagemaptool.c b/app/tools/gimpimagemaptool.c
index fcc4236..51690f9 100644
--- a/app/tools/gimpimagemaptool.c
+++ b/app/tools/gimpimagemaptool.c
@@ -59,7 +59,6 @@
 
 #include "display/gimpdisplay.h"
 #include "display/gimpdisplayshell.h"
-#include "display/gimpdisplayshell-transform.h"
 #include "display/gimptooldialog.h"
 
 #include "gimpcoloroptions.h"
@@ -581,34 +580,10 @@ gimp_image_map_tool_color_picked (GimpColorTool      *color_tool,
 static void
 gimp_image_map_tool_map (GimpImageMapTool *tool)
 {
-  GimpDisplayShell *shell = gimp_display_get_shell (GIMP_TOOL (tool)->display);
-  GimpItem         *item  = GIMP_ITEM (tool->drawable);
-  gint              x, y;
-  gint              w, h;
-  gint              off_x, off_y;
-  GeglRectangle     visible;
-
   if (GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->map)
     GIMP_IMAGE_MAP_TOOL_GET_CLASS (tool)->map (tool);
 
-  gimp_display_shell_untransform_viewport (shell, &x, &y, &w, &h);
-
-  gimp_item_get_offset (item, &off_x, &off_y);
-
-  gimp_rectangle_intersect (x, y, w, h,
-                            off_x,
-                            off_y,
-                            gimp_item_get_width  (item),
-                            gimp_item_get_height (item),
-                            &visible.x,
-                            &visible.y,
-                            &visible.width,
-                            &visible.height);
-
-  visible.x -= off_x;
-  visible.y -= off_y;
-
-  gimp_image_map_apply (tool->image_map, &visible);
+  gimp_image_map_apply (tool->image_map);
 }
 
 static void


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