[gimp/goat-invasion: 352/412] app: rename GimpPaintCore->canvas_buf to ->paint_area



commit 22dea8a65aab8dece6bd37e2c250e409422658bc
Author: Michael Natterer <mitch gimp org>
Date:   Sat Mar 31 17:00:48 2012 +0200

    app: rename GimpPaintCore->canvas_buf to ->paint_area
    
    because that's what it's called in public API. This has confused me
    long enough now.

 app/paint/gimpbrushcore.c |   12 ++--
 app/paint/gimpdodgeburn.c |    6 +-
 app/paint/gimpink.c       |   26 ++++----
 app/paint/gimppaintcore.c |  136 ++++++++++++++++++++++----------------------
 app/paint/gimppaintcore.h |    2 +-
 app/paint/gimpsmudge.c    |    4 +-
 6 files changed, 93 insertions(+), 93 deletions(-)
---
diff --git a/app/paint/gimpbrushcore.c b/app/paint/gimpbrushcore.c
index 507c4de..9670d57 100644
--- a/app/paint/gimpbrushcore.c
+++ b/app/paint/gimpbrushcore.c
@@ -829,11 +829,11 @@ gimp_brush_core_get_paint_area (GimpPaintCore    *paint_core,
 
       bytes = gimp_drawable_bytes_with_alpha (drawable);
 
-      paint_core->canvas_buf = temp_buf_resize (paint_core->canvas_buf, bytes,
+      paint_core->paint_area = temp_buf_resize (paint_core->paint_area, bytes,
                                                 x1, y1,
                                                 (x2 - x1), (y2 - y1));
 
-      return paint_core->canvas_buf;
+      return paint_core->paint_area;
     }
 
   return NULL;
@@ -939,8 +939,8 @@ gimp_brush_core_paste_canvas (GimpBrushCore            *core,
 
       pixel_region_init_temp_buf (&brush_maskPR, (TempBuf *) brush_mask,
                                   off_x, off_y,
-                                  paint_core->canvas_buf->width,
-                                  paint_core->canvas_buf->height);
+                                  paint_core->paint_area->width,
+                                  paint_core->paint_area->height);
 
       gimp_paint_core_paste (paint_core, &brush_maskPR, drawable,
                              brush_opacity,
@@ -985,8 +985,8 @@ gimp_brush_core_replace_canvas (GimpBrushCore            *core,
 
       pixel_region_init_temp_buf (&brush_maskPR, (TempBuf *) brush_mask,
                                   off_x, off_y,
-                                  paint_core->canvas_buf->width,
-                                  paint_core->canvas_buf->height);
+                                  paint_core->paint_area->width,
+                                  paint_core->paint_area->height);
 
       gimp_paint_core_replace (paint_core, &brush_maskPR, drawable,
                                brush_opacity,
diff --git a/app/paint/gimpdodgeburn.c b/app/paint/gimpdodgeburn.c
index 4d0a6aa..1ac10d2 100644
--- a/app/paint/gimpdodgeburn.c
+++ b/app/paint/gimpdodgeburn.c
@@ -247,12 +247,12 @@ gimp_dodge_burn_motion (GimpPaintCore    *paint_core,
   /*  DodgeBurn the region  */
   gimp_lut_process (dodgeburn->lut, &srcPR, &tempPR);
 
-  /* The dest is the paint area we got above (= canvas_buf) */
+  /* The dest is the paint area we got above (= paint_area) */
   pixel_region_init_temp_buf (&destPR, area,
                               0, 0, area->width, area->height);
 
   /* Now add an alpha to the dodgeburned region
-   * and put this in area = canvas_buf
+   * and put this in area = paint_area
    */
   if (! gimp_drawable_has_alpha (drawable))
     add_alpha_region (&tempPR, &destPR);
@@ -269,7 +269,7 @@ gimp_dodge_burn_motion (GimpPaintCore    *paint_core,
                                                     paint_options,
                                                     fade_point);
 
-  /* Replace the newly dodgedburned area (canvas_buf) to the image */
+  /* Replace the newly dodgedburned area (paint_area) to the image */
   gimp_brush_core_replace_canvas (GIMP_BRUSH_CORE (paint_core), drawable,
                                   coords,
                                   MIN (opacity, GIMP_OPACITY_OPAQUE),
diff --git a/app/paint/gimpink.c b/app/paint/gimpink.c
index ecabda9..9ab776f 100644
--- a/app/paint/gimpink.c
+++ b/app/paint/gimpink.c
@@ -220,13 +220,13 @@ gimp_ink_get_paint_area (GimpPaintCore    *paint_core,
 
   /*  configure the canvas buffer  */
   if ((x2 - x1) && (y2 - y1))
-    paint_core->canvas_buf = temp_buf_resize (paint_core->canvas_buf, bytes,
+    paint_core->paint_area = temp_buf_resize (paint_core->paint_area, bytes,
                                               x1, y1,
                                               (x2 - x1), (y2 - y1));
   else
     return NULL;
 
-  return paint_core->canvas_buf;
+  return paint_core->paint_area;
 }
 
 static GimpUndo *
@@ -306,27 +306,27 @@ gimp_ink_motion (GimpPaintCore    *paint_core,
                                      col);
 
   /*  color the pixels  */
-  color_pixels (temp_buf_get_data (paint_core->canvas_buf), col,
+  color_pixels (temp_buf_get_data (paint_core->paint_area), col,
                 area->width * area->height, area->bytes);
 
-  /*  draw the blob directly to the canvas_tiles  */
+  /*  draw the blob directly to the canvas_buffer  */
   pixel_region_init (&blob_maskPR,
                      gimp_gegl_buffer_get_tiles (paint_core->canvas_buffer),
-                     paint_core->canvas_buf->x,
-                     paint_core->canvas_buf->y,
-                     paint_core->canvas_buf->width,
-                     paint_core->canvas_buf->height,
+                     paint_core->paint_area->x,
+                     paint_core->paint_area->y,
+                     paint_core->paint_area->width,
+                     paint_core->paint_area->height,
                      TRUE);
 
   render_blob (blob_to_render, &blob_maskPR);
 
-  /*  draw the canvas_buf using the just rendered canvas_tiles as mask */
+  /*  draw the paint_area using the just rendered canvas_buffer as mask */
   pixel_region_init (&blob_maskPR,
                      gimp_gegl_buffer_get_tiles (paint_core->canvas_buffer),
-                     paint_core->canvas_buf->x,
-                     paint_core->canvas_buf->y,
-                     paint_core->canvas_buf->width,
-                     paint_core->canvas_buf->height,
+                     paint_core->paint_area->x,
+                     paint_core->paint_area->y,
+                     paint_core->paint_area->width,
+                     paint_core->paint_area->height,
                      FALSE);
 
   gimp_paint_core_paste (paint_core, &blob_maskPR, drawable,
diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c
index 55e0d04..bd5915d 100644
--- a/app/paint/gimppaintcore.c
+++ b/app/paint/gimppaintcore.c
@@ -103,13 +103,13 @@ static GimpUndo* gimp_paint_core_real_push_undo      (GimpPaintCore    *core,
                                                       GimpImage        *image,
                                                       const gchar      *undo_desc);
 
-static void      paint_mask_to_canvas_tiles          (GimpPaintCore    *core,
+static void      paint_mask_to_canvas_buffer         (GimpPaintCore    *core,
                                                       PixelRegion      *paint_maskPR,
                                                       gdouble           paint_opacity);
-static void      paint_mask_to_canvas_buf            (GimpPaintCore    *core,
+static void      paint_mask_to_paint_area            (GimpPaintCore    *core,
                                                       PixelRegion      *paint_maskPR,
                                                       gdouble           paint_opacity);
-static void      canvas_tiles_to_canvas_buf          (GimpPaintCore    *core);
+static void      canvas_buffer_to_paint_area         (GimpPaintCore    *core);
 
 
 G_DEFINE_TYPE (GimpPaintCore, gimp_paint_core, GIMP_TYPE_OBJECT)
@@ -548,10 +548,10 @@ gimp_paint_core_cleanup (GimpPaintCore *core)
       core->canvas_buffer = NULL;
     }
 
-  if (core->canvas_buf)
+  if (core->paint_area)
     {
-      temp_buf_free (core->canvas_buf);
-      core->canvas_buf = NULL;
+      temp_buf_free (core->paint_area);
+      core->paint_area = NULL;
     }
 }
 
@@ -702,20 +702,20 @@ gimp_paint_core_paste (GimpPaintCore            *core,
   GeglBuffer *canvas_buffer;
 
   /*  If the mode is CONSTANT:
-   *   combine the canvas buf, the paint mask to the canvas tiles
+   *   combine the canvas buf, the paint mask to the canvas buffer
    */
   if (mode == GIMP_PAINT_CONSTANT)
     {
-      /* Some tools (ink) paint the mask to paint_core->canvas_tiles
+      /* Some tools (ink) paint the mask to paint_core->canvas_buffer
        * directly. Don't need to copy it in this case.
        */
       if (paint_maskPR->tiles !=
           gimp_gegl_buffer_get_tiles (core->canvas_buffer))
         {
-          paint_mask_to_canvas_tiles (core, paint_maskPR, paint_opacity);
+          paint_mask_to_canvas_buffer (core, paint_maskPR, paint_opacity);
         }
 
-      canvas_tiles_to_canvas_buf (core);
+      canvas_buffer_to_paint_area (core);
 
       base_buffer = core->undo_buffer;
     }
@@ -724,42 +724,42 @@ gimp_paint_core_paste (GimpPaintCore            *core,
    */
   else
     {
-      paint_mask_to_canvas_buf (core, paint_maskPR, paint_opacity);
+      paint_mask_to_paint_area (core, paint_maskPR, paint_opacity);
     }
 
   /*  intialize canvas buf source pixel regions  */
   canvas_buffer =
-    gimp_temp_buf_create_buffer (core->canvas_buf,
+    gimp_temp_buf_create_buffer (core->paint_area,
                                  gimp_drawable_get_format_with_alpha (drawable));
 
   /*  apply the paint area to the image  */
   gimp_drawable_apply_buffer (drawable, canvas_buffer,
                               GIMP_GEGL_RECT (0, 0,
-                                              core->canvas_buf->width,
-                                              core->canvas_buf->height),
+                                              core->paint_area->width,
+                                              core->paint_area->height),
                               FALSE, NULL,
                               image_opacity, paint_mode,
                               base_buffer, /*  specify an alternative src1  */
-                              core->canvas_buf->x,
-                              core->canvas_buf->y,
+                              core->paint_area->x,
+                              core->paint_area->y,
                               NULL,
-                              core->canvas_buf->x,
-                              core->canvas_buf->y);
+                              core->paint_area->x,
+                              core->paint_area->y);
 
   g_object_unref (canvas_buffer);
 
   /*  Update the undo extents  */
-  core->x1 = MIN (core->x1, core->canvas_buf->x);
-  core->y1 = MIN (core->y1, core->canvas_buf->y);
-  core->x2 = MAX (core->x2, core->canvas_buf->x + core->canvas_buf->width);
-  core->y2 = MAX (core->y2, core->canvas_buf->y + core->canvas_buf->height);
+  core->x1 = MIN (core->x1, core->paint_area->x);
+  core->y1 = MIN (core->y1, core->paint_area->y);
+  core->x2 = MAX (core->x2, core->paint_area->x + core->paint_area->width);
+  core->y2 = MAX (core->y2, core->paint_area->y + core->paint_area->height);
 
   /*  Update the drawable  */
   gimp_drawable_update (drawable,
-                        core->canvas_buf->x,
-                        core->canvas_buf->y,
-                        core->canvas_buf->width,
-                        core->canvas_buf->height);
+                        core->paint_area->x,
+                        core->paint_area->y,
+                        core->paint_area->width,
+                        core->paint_area->height);
 }
 
 /* This works similarly to gimp_paint_core_paste. However, instead of
@@ -797,16 +797,16 @@ gimp_paint_core_replace (GimpPaintCore            *core,
       if (paint_maskPR->tiles !=
           gimp_gegl_buffer_get_tiles (core->canvas_buffer))
         {
-          /* combine the paint mask and the canvas tiles */
-          paint_mask_to_canvas_tiles (core, paint_maskPR, paint_opacity);
+          /* combine the paint mask and the canvas buffer */
+          paint_mask_to_canvas_buffer (core, paint_maskPR, paint_opacity);
 
-          /* initialize the maskPR from the canvas tiles */
+          /* initialize the maskPR from the canvas buffer */
           pixel_region_init (paint_maskPR,
                              gimp_gegl_buffer_get_tiles (core->canvas_buffer),
-                             core->canvas_buf->x,
-                             core->canvas_buf->y,
-                             core->canvas_buf->width,
-                             core->canvas_buf->height,
+                             core->paint_area->x,
+                             core->paint_area->y,
+                             core->paint_area->width,
+                             core->paint_area->height,
                              FALSE);
         }
     }
@@ -817,34 +817,34 @@ gimp_paint_core_replace (GimpPaintCore            *core,
 
   /*  intialize canvas buf source pixel regions  */
   canvas_buffer =
-    gimp_temp_buf_create_buffer (core->canvas_buf,
+    gimp_temp_buf_create_buffer (core->paint_area,
                                  gimp_drawable_get_format_with_alpha (drawable));
 
   /*  apply the paint area to the image  */
   gimp_drawable_replace_buffer (drawable, canvas_buffer,
                                 GIMP_GEGL_RECT (0, 0,
-                                                core->canvas_buf->width,
-                                                core->canvas_buf->height),
+                                                core->paint_area->width,
+                                                core->paint_area->height),
                                 FALSE, NULL,
                                 image_opacity,
                                 paint_maskPR,
-                                core->canvas_buf->x,
-                                core->canvas_buf->y);
+                                core->paint_area->x,
+                                core->paint_area->y);
 
   g_object_unref (canvas_buffer);
 
   /*  Update the undo extents  */
-  core->x1 = MIN (core->x1, core->canvas_buf->x);
-  core->y1 = MIN (core->y1, core->canvas_buf->y);
-  core->x2 = MAX (core->x2, core->canvas_buf->x + core->canvas_buf->width) ;
-  core->y2 = MAX (core->y2, core->canvas_buf->y + core->canvas_buf->height) ;
+  core->x1 = MIN (core->x1, core->paint_area->x);
+  core->y1 = MIN (core->y1, core->paint_area->y);
+  core->x2 = MAX (core->x2, core->paint_area->x + core->paint_area->width) ;
+  core->y2 = MAX (core->y2, core->paint_area->y + core->paint_area->height) ;
 
   /*  Update the drawable  */
   gimp_drawable_update (drawable,
-                        core->canvas_buf->x,
-                        core->canvas_buf->y,
-                        core->canvas_buf->width,
-                        core->canvas_buf->height);
+                        core->paint_area->x,
+                        core->paint_area->y,
+                        core->paint_area->width,
+                        core->paint_area->height);
 }
 
 /**
@@ -917,43 +917,43 @@ gimp_paint_core_smooth_coords (GimpPaintCore    *core,
 
 
 static void
-canvas_tiles_to_canvas_buf (GimpPaintCore *core)
+canvas_buffer_to_paint_area (GimpPaintCore *core)
 {
   PixelRegion srcPR;
   PixelRegion maskPR;
 
-  /*  combine the canvas tiles and the canvas buf  */
-  pixel_region_init_temp_buf (&srcPR, core->canvas_buf,
+  /*  combine the canvas buffer and the paint area  */
+  pixel_region_init_temp_buf (&srcPR, core->paint_area,
                               0, 0,
-                              core->canvas_buf->width,
-                              core->canvas_buf->height);
+                              core->paint_area->width,
+                              core->paint_area->height);
 
   pixel_region_init (&maskPR,
                      gimp_gegl_buffer_get_tiles (core->canvas_buffer),
-                     core->canvas_buf->x,
-                     core->canvas_buf->y,
-                     core->canvas_buf->width,
-                     core->canvas_buf->height,
+                     core->paint_area->x,
+                     core->paint_area->y,
+                     core->paint_area->width,
+                     core->paint_area->height,
                      FALSE);
 
-  /*  apply the canvas tiles to the canvas buf  */
+  /*  apply the canvas buffer to the paint area  */
   apply_mask_to_region (&srcPR, &maskPR, OPAQUE_OPACITY);
 }
 
 static void
-paint_mask_to_canvas_tiles (GimpPaintCore *core,
-                            PixelRegion   *paint_maskPR,
-                            gdouble        paint_opacity)
+paint_mask_to_canvas_buffer (GimpPaintCore *core,
+                             PixelRegion   *paint_maskPR,
+                             gdouble        paint_opacity)
 {
   PixelRegion srcPR;
 
-  /*   combine the paint mask and the canvas tiles  */
+  /*   combine the paint mask and the canvas buffer  */
   pixel_region_init (&srcPR,
                      gimp_gegl_buffer_get_tiles (core->canvas_buffer),
-                     core->canvas_buf->x,
-                     core->canvas_buf->y,
-                     core->canvas_buf->width,
-                     core->canvas_buf->height,
+                     core->paint_area->x,
+                     core->paint_area->y,
+                     core->paint_area->width,
+                     core->paint_area->height,
                      TRUE);
 
   /*  combine the mask to the canvas tiles  */
@@ -962,17 +962,17 @@ paint_mask_to_canvas_tiles (GimpPaintCore *core,
 }
 
 static void
-paint_mask_to_canvas_buf (GimpPaintCore *core,
+paint_mask_to_paint_area (GimpPaintCore *core,
                           PixelRegion   *paint_maskPR,
                           gdouble        paint_opacity)
 {
   PixelRegion srcPR;
 
   /*  combine the canvas buf and the paint mask to the canvas buf  */
-  pixel_region_init_temp_buf (&srcPR, core->canvas_buf,
+  pixel_region_init_temp_buf (&srcPR, core->paint_area,
                               0, 0,
-                              core->canvas_buf->width,
-                              core->canvas_buf->height);
+                              core->paint_area->width,
+                              core->paint_area->height);
 
   /*  apply the mask  */
   apply_mask_to_region (&srcPR, paint_maskPR, paint_opacity * 255.999);
diff --git a/app/paint/gimppaintcore.h b/app/paint/gimppaintcore.h
index a05f158..163910b 100644
--- a/app/paint/gimppaintcore.h
+++ b/app/paint/gimppaintcore.h
@@ -59,7 +59,7 @@ struct _GimpPaintCore
   GeglBuffer  *saved_proj_buffer; /*  proj tiles which have been modified */
   GeglBuffer  *canvas_buffer;     /*  the buffer to paint the mask to     */
 
-  TempBuf     *canvas_buf;        /*  the buffer to paint pixels to       */
+  TempBuf     *paint_area;        /*  the buffer to paint pixels to       */
 
   GArray      *stroke_buffer;
 };
diff --git a/app/paint/gimpsmudge.c b/app/paint/gimpsmudge.c
index 4318109..f82e470 100644
--- a/app/paint/gimpsmudge.c
+++ b/app/paint/gimpsmudge.c
@@ -325,7 +325,7 @@ gimp_smudge_motion (GimpPaintCore    *paint_core,
                           area->width,
                           area->height);
 
-  /* The dest will be the paint area we got above (= canvas_buf) */
+  /* The dest will be the paint area we got above (= paint_area) */
   pixel_region_init_temp_buf (&destPR, area,
                               0, 0, area->width, area->height);
 
@@ -333,7 +333,7 @@ gimp_smudge_motion (GimpPaintCore    *paint_core,
    *  For each successive painthit Accum is built like this
    *    Accum =  rate*Accum  + (1-rate)*I.
    *  where I is the pixels under the current painthit.
-   *  Then the paint area (canvas_buf) is built as
+   *  Then the paint area (paint_area) is built as
    *    (Accum,1) (if no alpha),
    */
 



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