Commit b926de5a authored by Michael Natterer's avatar Michael Natterer 😴

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.
parent 4ac359dc
......@@ -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,
......
......@@ -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,
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment