Index: gimp/app/paint/gimppaintcore.c
===================================================================
RCS file: /cvs/gnome/gimp/app/paint/gimppaintcore.c,v
retrieving revision 1.107
diff -u -p -r1.107 gimppaintcore.c
--- a/gimp/app/paint/gimppaintcore.c	21 May 2004 15:23:28 -0000	1.107
+++ b/gimp/app/paint/gimppaintcore.c	24 May 2004 09:06:49 -0000
@@ -51,8 +51,9 @@
 #include "gimppaintcore-undo.h"
 #include "gimppaintoptions.h"
 
-#include "gimp-intl.h"
+#include "gimpairbrush.h"
 
+#include "gimp-intl.h"
 
 #define EPSILON  0.00001
 
@@ -1880,7 +1881,8 @@ brush_to_canvas_tiles (GimpPaintCore *co
                                                    xoff * maskPR.bytes);
 
   /*  combine the mask to the canvas tiles  */
-  combine_mask_and_region (&srcPR, &maskPR, brush_opacity * 255.999);
+  combine_mask_and_region (&srcPR, &maskPR, brush_opacity * 255.999,
+                           GIMP_IS_AIRBRUSH (core));
 }
 
 static void
Index: gimp/app/paint-funcs/paint-funcs-generic.h
===================================================================
RCS file: /cvs/gnome/gimp/app/paint-funcs/paint-funcs-generic.h,v
retrieving revision 1.22
diff -u -p -r1.22 paint-funcs-generic.h
--- a/gimp/app/paint-funcs/paint-funcs-generic.h	15 Apr 2004 12:38:54 -0000	1.22
+++ b/gimp/app/paint-funcs/paint-funcs-generic.h	24 May 2004 09:06:49 -0000
@@ -1379,34 +1379,71 @@ apply_mask_to_alpha_channel (guchar     
 
 
 inline void
-combine_mask_and_alpha_channel (guchar       *src,
-                                const guchar *mask,
-                                guint         opacity,
-                                guint         length,
-                                guint         bytes)
+combine_mask_and_alpha_channel_stipple (guchar       *src,
+                                        const guchar *mask,
+                                        guint         opacity,
+                                        guint         length,
+                                        guint         bytes)
 {
   gint mask_val;
-  gint alpha;
   gint tmp;
 
-  alpha = bytes - 1;
-  src += alpha;
+  /* align with alpha channel */
+  src += bytes - 1;
 
   if (opacity != 255)
     while (length --)
-    {
-      mask_val = INT_MULT(*mask, opacity, tmp);
-      mask++;
-      *src = *src + INT_MULT((255 - *src) , mask_val, tmp);
-      src += bytes;
-    }
+      {
+        mask_val = INT_MULT(*mask, opacity, tmp);
+        *src = *src + INT_MULT((255 - *src) , mask_val, tmp);
+
+        src += bytes;
+        mask++;
+      }
   else
     while (length --)
-    {
-      *src = *src + INT_MULT((255 - *src) , *mask, tmp);
-      src += bytes;
-      mask++;
-    }
+      {
+        *src = *src + INT_MULT((255 - *src) , *mask, tmp);
+
+        src += bytes;
+        mask++;
+      }
+}
+
+
+inline void
+combine_mask_and_alpha_channel_stroke (guchar       *src,
+                                       const guchar *mask,
+                                       guint         opacity,
+                                       guint         length,
+                                       guint         bytes)
+{
+  gint mask_val;
+  gint tmp;
+
+  /* align with alpha channel */
+  src += bytes - 1;
+
+  if (opacity != 255)
+    while (length --)
+      {
+        if (opacity > *src)
+          {
+            mask_val = INT_MULT(*mask, opacity, tmp);
+            *src = *src + INT_MULT((opacity - *src) , mask_val, tmp);
+          }
+
+        src += bytes;
+        mask++;
+      }
+  else
+    while (length --)
+      {
+        *src = *src + INT_MULT((255 - *src) , *mask, tmp);
+
+        src += bytes;
+        mask++;
+      }
 }
 
 
Index: gimp/app/paint-funcs/paint-funcs.c
===================================================================
RCS file: /cvs/gnome/gimp/app/paint-funcs/paint-funcs.c,v
retrieving revision 1.159
diff -u -p -r1.159 paint-funcs.c
--- a/gimp/app/paint-funcs/paint-funcs.c	15 Apr 2004 12:38:54 -0000	1.159
+++ b/gimp/app/paint-funcs/paint-funcs.c	24 May 2004 09:06:50 -0000
@@ -4233,9 +4233,9 @@ apply_mask_to_region (PixelRegion *src,
 
 
 static void
-combine_mask_and_sub_region (gint        *opacityp,
-                             PixelRegion *src,
-                             PixelRegion *mask)
+combine_mask_and_sub_region_stipple (gint        *opacityp,
+                                     PixelRegion *src,
+                                     PixelRegion *mask)
 {
   gint    h;
   guchar *s;
@@ -4248,20 +4248,48 @@ combine_mask_and_sub_region (gint       
 
   while (h --)
     {
-      combine_mask_and_alpha_channel (s, m, opacity, src->w, src->bytes);
+      combine_mask_and_alpha_channel_stipple (s, m, opacity, src->w, src->bytes);
       s += src->rowstride;
       m += mask->rowstride;
     }
 }
 
+
+static void
+combine_mask_and_sub_region_stroke (gint        *opacityp,
+                                    PixelRegion *src,
+                                    PixelRegion *mask)
+{
+  gint    h;
+  guchar *s;
+  guchar *m;
+  guint   opacity = *opacityp;
+
+  s = src->data;
+  m = mask->data;
+  h = src->h;
+
+  while (h --)
+    {
+      combine_mask_and_alpha_channel_stroke (s, m, opacity, src->w, src->bytes);
+      s += src->rowstride;
+      m += mask->rowstride;
+    }
+}
+
+
 void
 combine_mask_and_region (PixelRegion *src,
                          PixelRegion *mask,
-                         guint        opacity)
+                         guint        opacity,
+                         gboolean     stipple)
 {
-
-  pixel_regions_process_parallel ((p_func)combine_mask_and_sub_region,
-                                  &opacity, 2, src, mask);
+  if (stipple)
+    pixel_regions_process_parallel ((p_func)combine_mask_and_sub_region_stipple,
+                                    &opacity, 2, src, mask);
+  else
+    pixel_regions_process_parallel ((p_func)combine_mask_and_sub_region_stroke,
+                                    &opacity, 2, src, mask);
 }
 
 
Index: gimp/app/paint-funcs/paint-funcs.h
===================================================================
RCS file: /cvs/gnome/gimp/app/paint-funcs/paint-funcs.h,v
retrieving revision 1.43
diff -u -p -r1.43 paint-funcs.h
--- a/gimp/app/paint-funcs/paint-funcs.h	15 Apr 2004 12:38:54 -0000	1.43
+++ b/gimp/app/paint-funcs/paint-funcs.h	24 May 2004 09:06:50 -0000
@@ -400,7 +400,8 @@ void  apply_mask_to_region              
 /*  Combine a mask with an image's alpha channel  */
 void  combine_mask_and_region             (PixelRegion *src,
                                            PixelRegion *mask,
-                                           guint        opacity);
+                                           guint        opacity,
+                                           gboolean     stipple);
 
 /*  Copy a gray image to an intensity-alpha region  */
 void  copy_gray_to_region                 (PixelRegion *src,
