gimp r27535 - in trunk: . app/core app/text app/tools



Author: mitch
Date: Mon Nov  3 20:51:46 2008
New Revision: 27535
URL: http://svn.gnome.org/viewvc/gimp?rev=27535&view=rev

Log:
2008-11-03  Michael Natterer  <mitch gimp org>

	* app/core/gimpdrawable.[ch] (gimp_drawable_set_tiles): add
	"GimpImageType type" parameter because there are only a few calls
	to this function which (can easily pass the current type); however
	most calls to gimp_drawable_set_tiles_full() were just using the
	function because of the type argument and passed in the item's
	current offsets (which means peeking into the item struct or using
	temp variables).

	* app/core/gimpdrawable-offset.c (gimp_drawable_offset)
	* app/text/gimptextlayer.c (gimp_text_layer_render)
	* app/tools/gimptransformtool.c (gimp_transform_tool_doit): pass
	the type to set_tiles().

	* app/core/gimpchannel.c (gimp_channel_convert)
	* app/core/gimpimage-convert.c (gimp_image_convert)
	* app/core/gimplayer.c (gimp_layer_convert,add_alpha,flatten):
	change calls to set_tiles_full() into set_tiles() because the
	offset doesn't change.



Modified:
   trunk/ChangeLog
   trunk/app/core/gimpchannel.c
   trunk/app/core/gimpdrawable-offset.c
   trunk/app/core/gimpdrawable.c
   trunk/app/core/gimpdrawable.h
   trunk/app/core/gimpimage-convert.c
   trunk/app/core/gimplayer.c
   trunk/app/text/gimptextlayer.c
   trunk/app/tools/gimptransformtool.c

Modified: trunk/app/core/gimpchannel.c
==============================================================================
--- trunk/app/core/gimpchannel.c	(original)
+++ trunk/app/core/gimpchannel.c	Mon Nov  3 20:51:46 2008
@@ -437,10 +437,8 @@
 
       gimp_drawable_convert_grayscale (drawable, new_tiles, old_base_type);
 
-      gimp_drawable_set_tiles_full (drawable, FALSE, NULL,
-                                    new_tiles, new_type,
-                                    item->offset_x,
-                                    item->offset_y);
+      gimp_drawable_set_tiles (drawable, FALSE, NULL,
+                               new_tiles, new_type);
       tile_manager_unref (new_tiles);
     }
 

Modified: trunk/app/core/gimpdrawable-offset.c
==============================================================================
--- trunk/app/core/gimpdrawable-offset.c	(original)
+++ trunk/app/core/gimpdrawable-offset.c	Mon Nov  3 20:51:46 2008
@@ -313,6 +313,7 @@
     }
 
   gimp_drawable_set_tiles (drawable, gimp_item_is_attached (item),
-                           _("Offset Drawable"), new_tiles);
+                           _("Offset Drawable"), new_tiles,
+                           gimp_drawable_type (drawable));
   tile_manager_unref (new_tiles);
 }

Modified: trunk/app/core/gimpdrawable.c
==============================================================================
--- trunk/app/core/gimpdrawable.c	(original)
+++ trunk/app/core/gimpdrawable.c	Mon Nov  3 20:51:46 2008
@@ -1044,10 +1044,11 @@
 }
 
 void
-gimp_drawable_set_tiles (GimpDrawable *drawable,
-                         gboolean      push_undo,
-                         const gchar  *undo_desc,
-                         TileManager  *tiles)
+gimp_drawable_set_tiles (GimpDrawable  *drawable,
+                         gboolean       push_undo,
+                         const gchar   *undo_desc,
+                         TileManager   *tiles,
+                         GimpImageType  type)
 {
   gint offset_x, offset_y;
 
@@ -1059,8 +1060,7 @@
 
   gimp_item_get_offset (GIMP_ITEM (drawable), &offset_x, &offset_y);
 
-  gimp_drawable_set_tiles_full (drawable, push_undo, undo_desc, tiles,
-                                gimp_drawable_type (drawable),
+  gimp_drawable_set_tiles_full (drawable, push_undo, undo_desc, tiles, type,
                                 offset_x, offset_y);
 }
 

Modified: trunk/app/core/gimpdrawable.h
==============================================================================
--- trunk/app/core/gimpdrawable.h	(original)
+++ trunk/app/core/gimpdrawable.h	Mon Nov  3 20:51:46 2008
@@ -163,7 +163,8 @@
 void            gimp_drawable_set_tiles          (GimpDrawable       *drawable,
                                                   gboolean            push_undo,
                                                   const gchar        *undo_desc,
-                                                  TileManager        *tiles);
+                                                  TileManager        *tiles,
+                                                  GimpImageType       type);
 void            gimp_drawable_set_tiles_full     (GimpDrawable       *drawable,
                                                   gboolean            push_undo,
                                                   const gchar        *undo_desc,

Modified: trunk/app/core/gimpimage-convert.c
==============================================================================
--- trunk/app/core/gimpimage-convert.c	(original)
+++ trunk/app/core/gimpimage-convert.c	Mon Nov  3 20:51:46 2008
@@ -990,10 +990,8 @@
           break;
         }
 
-      gimp_drawable_set_tiles_full (GIMP_DRAWABLE (layer), TRUE, NULL,
-                                    new_tiles, new_layer_type,
-                                    GIMP_ITEM (layer)->offset_x,
-                                    GIMP_ITEM (layer)->offset_y);
+      gimp_drawable_set_tiles (GIMP_DRAWABLE (layer), TRUE, NULL,
+                               new_tiles, new_layer_type);
       tile_manager_unref (new_tiles);
     }
 

Modified: trunk/app/core/gimplayer.c
==============================================================================
--- trunk/app/core/gimplayer.c	(original)
+++ trunk/app/core/gimplayer.c	Mon Nov  3 20:51:46 2008
@@ -676,10 +676,8 @@
           break;
         }
 
-      gimp_drawable_set_tiles_full (drawable, FALSE, NULL,
-                                    new_tiles, new_type,
-                                    GIMP_ITEM (layer)->offset_x,
-                                    GIMP_ITEM (layer)->offset_y);
+      gimp_drawable_set_tiles (drawable, FALSE, NULL,
+                               new_tiles, new_type);
       tile_manager_unref (new_tiles);
     }
 
@@ -1745,12 +1743,10 @@
   add_alpha_region (&srcPR, &destPR);
 
   /*  Set the new tiles  */
-  gimp_drawable_set_tiles_full (GIMP_DRAWABLE (layer),
-                                gimp_item_is_attached (GIMP_ITEM (layer)),
-                                _("Add Alpha Channel"),
-                                new_tiles, new_type,
-                                item->offset_x,
-                                item->offset_y);
+  gimp_drawable_set_tiles (GIMP_DRAWABLE (layer),
+                           gimp_item_is_attached (GIMP_ITEM (layer)),
+                           _("Add Alpha Channel"),
+                           new_tiles, new_type);
   tile_manager_unref (new_tiles);
 }
 
@@ -1799,12 +1795,10 @@
   flatten_region (&srcPR, &destPR, bg);
 
   /*  Set the new tiles  */
-  gimp_drawable_set_tiles_full (GIMP_DRAWABLE (layer),
-                                gimp_item_is_attached (GIMP_ITEM (layer)),
-                                _("Remove Alpha Channel"),
-                                new_tiles, new_type,
-                                item->offset_x,
-                                item->offset_y);
+  gimp_drawable_set_tiles (GIMP_DRAWABLE (layer),
+                           gimp_item_is_attached (GIMP_ITEM (layer)),
+                           _("Remove Alpha Channel"),
+                           new_tiles, new_type);
   tile_manager_unref (new_tiles);
 }
 

Modified: trunk/app/text/gimptextlayer.c
==============================================================================
--- trunk/app/text/gimptextlayer.c	(original)
+++ trunk/app/text/gimptextlayer.c	Mon Nov  3 20:51:46 2008
@@ -560,7 +560,8 @@
       TileManager *new_tiles = tile_manager_new (width, height,
                                                  drawable->bytes);
 
-      gimp_drawable_set_tiles (drawable, FALSE, NULL, new_tiles);
+      gimp_drawable_set_tiles (drawable, FALSE, NULL, new_tiles,
+                               gimp_drawable_type (drawable));
 
       tile_manager_unref (new_tiles);
 

Modified: trunk/app/tools/gimptransformtool.c
==============================================================================
--- trunk/app/tools/gimptransformtool.c	(original)
+++ trunk/app/tools/gimptransformtool.c	Mon Nov  3 20:51:46 2008
@@ -1261,7 +1261,8 @@
           gimp_channel_push_undo (GIMP_CHANNEL (active_item), NULL);
 
           gimp_drawable_set_tiles (GIMP_DRAWABLE (active_item),
-                                   FALSE, NULL, new_tiles);
+                                   FALSE, NULL, new_tiles,
+                                   gimp_drawable_type (GIMP_DRAWABLE (active_item)));
           tile_manager_unref (new_tiles);
         }
 



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