[gimp] Bug 783755 - Smudge should blend the smudged colors using linear RGB



commit b926de5adad6d5b6adf4bfa2b784910aba1f2eeb
Author: Michael Natterer <mitch gimp org>
Date:   Sat Aug 12 21:35:47 2017 +0200

    Bug 783755 - Smudge should blend the smudged colors using linear RGB
    
    Use GIMP_LAYER_MODE_NORMAL (not NORMAL_LEGACY) when falling back from
    gimp_paint_core_replace() to gimp_paint_core_paste() for layers
    without alpha. Adapt the format of the used paint buffers accordingly.

 app/paint/gimpconvolve.c  |    2 +-
 app/paint/gimpdodgeburn.c |    2 +-
 app/paint/gimpheal.c      |   36 ++++++++++++++++++++++++++++++++++--
 app/paint/gimppaintcore.c |    2 +-
 app/paint/gimpsmudge.c    |    4 ++--
 5 files changed, 39 insertions(+), 7 deletions(-)
---
diff --git a/app/paint/gimpconvolve.c b/app/paint/gimpconvolve.c
index fb04273..91ca86e 100644
--- a/app/paint/gimpconvolve.c
+++ b/app/paint/gimpconvolve.c
@@ -167,7 +167,7 @@ gimp_convolve_motion (GimpPaintCore    *paint_core,
 
       paint_buffer = gimp_paint_core_get_paint_buffer (paint_core, drawable,
                                                        paint_options,
-                                                       GIMP_LAYER_MODE_NORMAL_LEGACY,
+                                                       GIMP_LAYER_MODE_NORMAL,
                                                        coords,
                                                        &paint_buffer_x,
                                                        &paint_buffer_y,
diff --git a/app/paint/gimpdodgeburn.c b/app/paint/gimpdodgeburn.c
index f21b62a..ae87d06 100644
--- a/app/paint/gimpdodgeburn.c
+++ b/app/paint/gimpdodgeburn.c
@@ -151,7 +151,7 @@ gimp_dodge_burn_motion (GimpPaintCore    *paint_core,
 
       paint_buffer = gimp_paint_core_get_paint_buffer (paint_core, drawable,
                                                        paint_options,
-                                                       GIMP_LAYER_MODE_NORMAL_LEGACY,
+                                                       GIMP_LAYER_MODE_NORMAL,
                                                        coords,
                                                        &paint_buffer_x,
                                                        &paint_buffer_y,
diff --git a/app/paint/gimpheal.c b/app/paint/gimpheal.c
index 56322b8..e0e50a0 100644
--- a/app/paint/gimpheal.c
+++ b/app/paint/gimpheal.c
@@ -69,6 +69,15 @@ static gboolean     gimp_heal_start              (GimpPaintCore    *paint_core,
                                                   GimpPaintOptions *paint_options,
                                                   const GimpCoords *coords,
                                                   GError          **error);
+static GeglBuffer * gimp_heal_get_paint_buffer   (GimpPaintCore    *core,
+                                                  GimpDrawable     *drawable,
+                                                  GimpPaintOptions *paint_options,
+                                                  GimpLayerMode     paint_mode,
+                                                  const GimpCoords *coords,
+                                                  gint             *paint_buffer_x,
+                                                  gint             *paint_buffer_y,
+                                                  gint             *paint_width,
+                                                  gint             *paint_height);
 
 static void         gimp_heal_motion             (GimpSourceCore   *source_core,
                                                   GimpDrawable     *drawable,
@@ -113,9 +122,10 @@ gimp_heal_class_init (GimpHealClass *klass)
   GimpPaintCoreClass  *paint_core_class  = GIMP_PAINT_CORE_CLASS (klass);
   GimpSourceCoreClass *source_core_class = GIMP_SOURCE_CORE_CLASS (klass);
 
-  paint_core_class->start   = gimp_heal_start;
+  paint_core_class->start            = gimp_heal_start;
+  paint_core_class->get_paint_buffer = gimp_heal_get_paint_buffer;
 
-  source_core_class->motion = gimp_heal_motion;
+  source_core_class->motion          = gimp_heal_motion;
 }
 
 static void
@@ -149,6 +159,28 @@ gimp_heal_start (GimpPaintCore     *paint_core,
   return TRUE;
 }
 
+static GeglBuffer *
+gimp_heal_get_paint_buffer (GimpPaintCore    *core,
+                            GimpDrawable     *drawable,
+                            GimpPaintOptions *paint_options,
+                            GimpLayerMode     paint_mode,
+                            const GimpCoords *coords,
+                            gint             *paint_buffer_x,
+                            gint             *paint_buffer_y,
+                            gint             *paint_width,
+                            gint             *paint_height)
+{
+  return GIMP_PAINT_CORE_CLASS (parent_class)->get_paint_buffer (core,
+                                                                 drawable,
+                                                                 paint_options,
+                                                                 GIMP_LAYER_MODE_NORMAL,
+                                                                 coords,
+                                                                 paint_buffer_x,
+                                                                 paint_buffer_y,
+                                                                 paint_width,
+                                                                 paint_height);
+}
+
 /* Subtract bottom from top and store in result as a float
  */
 static void
diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c
index 3488902..b70efc0 100644
--- a/app/paint/gimppaintcore.c
+++ b/app/paint/gimppaintcore.c
@@ -987,7 +987,7 @@ gimp_paint_core_replace (GimpPaintCore            *core,
                              drawable,
                              paint_opacity,
                              image_opacity,
-                             GIMP_LAYER_MODE_NORMAL_LEGACY,
+                             GIMP_LAYER_MODE_NORMAL,
                              mode);
       return;
     }
diff --git a/app/paint/gimpsmudge.c b/app/paint/gimpsmudge.c
index 6c1d9eb..f414ef5 100644
--- a/app/paint/gimpsmudge.c
+++ b/app/paint/gimpsmudge.c
@@ -218,7 +218,7 @@ gimp_smudge_start (GimpPaintCore    *paint_core,
        */
       paint_buffer = gimp_paint_core_get_paint_buffer (paint_core, drawable,
                                                        paint_options,
-                                                       GIMP_LAYER_MODE_NORMAL_LEGACY,
+                                                       GIMP_LAYER_MODE_NORMAL,
                                                        coords,
                                                        &paint_buffer_x,
                                                        &paint_buffer_y,
@@ -378,7 +378,7 @@ gimp_smudge_motion (GimpPaintCore    *paint_core,
 
       paint_buffer = gimp_paint_core_get_paint_buffer (paint_core, drawable,
                                                        paint_options,
-                                                       GIMP_LAYER_MODE_NORMAL_LEGACY,
+                                                       GIMP_LAYER_MODE_NORMAL,
                                                        coords,
                                                        &paint_buffer_x,
                                                        &paint_buffer_y,


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