[gimp] app: small cleanup in gimp_paint_core_start()



commit bef35224b331caaf59dd1fc85bdef3ada98f5cc1
Author: Michael Natterer <mitch gimp org>
Date:   Mon Jun 11 12:39:42 2012 +0200

    app: small cleanup in gimp_paint_core_start()

 app/paint/gimppaintcore.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c
index 839f6bb..8fc8139 100644
--- a/app/paint/gimppaintcore.c
+++ b/app/paint/gimppaintcore.c
@@ -328,7 +328,8 @@ gimp_paint_core_start (GimpPaintCore     *core,
                        const GimpCoords  *coords,
                        GError           **error)
 {
-  GimpItem *item;
+  GimpImage *image;
+  GimpItem  *item;
 
   g_return_val_if_fail (GIMP_IS_PAINT_CORE (core), FALSE);
   g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
@@ -337,7 +338,8 @@ gimp_paint_core_start (GimpPaintCore     *core,
   g_return_val_if_fail (coords != NULL, FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
-  item = GIMP_ITEM (drawable);
+  item  = GIMP_ITEM (drawable);
+  image = gimp_item_get_image (item);
 
   if (core->stroke_buffer)
     {
@@ -373,7 +375,6 @@ gimp_paint_core_start (GimpPaintCore     *core,
 
   if (core->use_saved_proj)
     {
-      GimpImage    *image    = gimp_item_get_image (item);
       GimpPickable *pickable = GIMP_PICKABLE (gimp_image_get_projection (image));
       GeglBuffer   *buffer   = gimp_pickable_get_buffer (pickable);
 
@@ -399,15 +400,11 @@ gimp_paint_core_start (GimpPaintCore     *core,
   core->last_paint.y = -1e6;
 
   {
-    GimpImage   *image;
-    GimpChannel *mask;
+    GimpChannel *mask        = gimp_image_get_mask (image);
     GeglBuffer  *mask_buffer = NULL;
     gint         offset_x    = 0;
     gint         offset_y    = 0;
 
-    image = gimp_item_get_image (item);
-    mask  = gimp_image_get_mask (image);
-
     /*  don't apply the mask to itself and don't apply an empty mask  */
     if (GIMP_DRAWABLE (mask) == drawable || gimp_channel_is_empty (mask))
       mask = NULL;



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