[gimp] app: remove "gboolean linear" parameters
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: remove "gboolean linear" parameters
- Date: Tue, 17 Jan 2017 23:17:34 +0000 (UTC)
commit 12623705449e1e04d9452a0b6a71b9f66b3da46f
Author: Michael Natterer <mitch gimp org>
Date: Wed Jan 18 00:15:55 2017 +0100
app: remove "gboolean linear" parameters
from gimp_applicator_new() and gimp_gegl_mode_node_set_mode().
Compositing doesn't depend on the layer format any longer, only on the
layer mode. Painting with "use applicator" unchecked is still broken
in some cases and needs more fixing.
app/core/gimpdrawable-combine.c | 3 +--
app/core/gimpdrawable-floating-selection.c | 5 +----
app/core/gimpdrawablefilter.c | 5 +----
app/core/gimpimage-merge.c | 5 +----
app/core/gimplayer.c | 6 +-----
app/gegl/gimp-gegl-nodes.c | 3 +--
app/gegl/gimp-gegl-nodes.h | 4 ++--
app/gegl/gimpapplicator.c | 9 ++-------
app/gegl/gimpapplicator.h | 2 --
app/paint/gimppaintcore.c | 16 ++++++++--------
10 files changed, 18 insertions(+), 40 deletions(-)
---
diff --git a/app/core/gimpdrawable-combine.c b/app/core/gimpdrawable-combine.c
index 4f608e5..635a778 100644
--- a/app/core/gimpdrawable-combine.c
+++ b/app/core/gimpdrawable-combine.c
@@ -119,8 +119,7 @@ gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
}
}
- applicator = gimp_applicator_new (NULL, gimp_drawable_get_linear (drawable),
- FALSE, FALSE);
+ applicator = gimp_applicator_new (NULL, FALSE, FALSE);
if (mask)
{
diff --git a/app/core/gimpdrawable-floating-selection.c b/app/core/gimpdrawable-floating-selection.c
index bb62821..0ceff8b 100644
--- a/app/core/gimpdrawable-floating-selection.c
+++ b/app/core/gimpdrawable-floating-selection.c
@@ -163,7 +163,6 @@ _gimp_drawable_add_floating_sel_filter (GimpDrawable *drawable)
GimpLayer *fs = gimp_drawable_get_floating_sel (drawable);
GeglNode *node;
GeglNode *fs_source;
- gboolean linear;
if (! private->source_node)
return;
@@ -175,7 +174,6 @@ _gimp_drawable_add_floating_sel_filter (GimpDrawable *drawable)
node = gimp_filter_get_node (private->fs_filter);
fs_source = gimp_drawable_get_source_node (GIMP_DRAWABLE (fs));
- linear = gimp_drawable_get_linear (GIMP_DRAWABLE (fs));
/* rip the fs' source node out of its graph */
if (fs->layer_offset_node)
@@ -187,8 +185,7 @@ _gimp_drawable_add_floating_sel_filter (GimpDrawable *drawable)
gegl_node_add_child (node, fs_source);
- private->fs_applicator = gimp_applicator_new (node, linear,
- FALSE, FALSE);
+ private->fs_applicator = gimp_applicator_new (node, FALSE, FALSE);
private->fs_crop_node =
gegl_node_new_child (node,
diff --git a/app/core/gimpdrawablefilter.c b/app/core/gimpdrawablefilter.c
index 5deeb9f..62a4a31 100644
--- a/app/core/gimpdrawablefilter.c
+++ b/app/core/gimpdrawablefilter.c
@@ -214,10 +214,7 @@ gimp_drawable_filter_new (GimpDrawable *drawable,
gegl_node_add_child (node, operation);
- filter->applicator =
- gimp_applicator_new (node,
- gimp_drawable_get_linear (filter->drawable),
- TRUE, TRUE);
+ filter->applicator = gimp_applicator_new (node, TRUE, TRUE);
gimp_filter_set_applicator (GIMP_FILTER (filter), filter->applicator);
diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c
index 2e729f8..5a8b24e 100644
--- a/app/core/gimpimage-merge.c
+++ b/app/core/gimpimage-merge.c
@@ -618,10 +618,7 @@ gimp_image_merge_layers (GimpImage *image,
merge_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (merge_layer));
layer_buffer = gimp_drawable_get_buffer (GIMP_DRAWABLE (layer));
- applicator =
- gimp_applicator_new (NULL,
- gimp_drawable_get_linear (GIMP_DRAWABLE (layer)),
- FALSE, FALSE);
+ applicator = gimp_applicator_new (NULL, FALSE, FALSE);
if (gimp_layer_get_mask (layer) &&
gimp_layer_get_apply_mask (layer))
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index d6ff559..b716ba3 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -510,14 +510,12 @@ gimp_layer_update_mode_node (GimpLayer *layer)
{
GeglNode *mode_node;
GimpLayerMode visible_mode;
- gboolean linear;
mode_node = gimp_drawable_get_mode_node (GIMP_DRAWABLE (layer));
if (layer->mask && layer->show_mask)
{
visible_mode = GIMP_LAYER_MODE_NORMAL;
- linear = TRUE;
}
else
{
@@ -530,11 +528,9 @@ gimp_layer_update_mode_node (GimpLayer *layer)
{
visible_mode = layer->mode;
}
-
- linear = gimp_drawable_get_linear (GIMP_DRAWABLE (layer));
}
- gimp_gegl_mode_node_set_mode (mode_node, visible_mode, linear);
+ gimp_gegl_mode_node_set_mode (mode_node, visible_mode);
gimp_gegl_mode_node_set_opacity (mode_node, layer->opacity);
}
diff --git a/app/gegl/gimp-gegl-nodes.c b/app/gegl/gimp-gegl-nodes.c
index 9341c2e..f0f2332 100644
--- a/app/gegl/gimp-gegl-nodes.c
+++ b/app/gegl/gimp-gegl-nodes.c
@@ -142,8 +142,7 @@ gimp_gegl_add_buffer_source (GeglNode *parent,
void
gimp_gegl_mode_node_set_mode (GeglNode *node,
- GimpLayerMode mode,
- gboolean linear)
+ GimpLayerMode mode)
{
gdouble opacity;
diff --git a/app/gegl/gimp-gegl-nodes.h b/app/gegl/gimp-gegl-nodes.h
index 70abbb1..e1233c9 100644
--- a/app/gegl/gimp-gegl-nodes.h
+++ b/app/gegl/gimp-gegl-nodes.h
@@ -33,10 +33,10 @@ GeglNode * gimp_gegl_add_buffer_source (GeglNode *parent,
gint offset_y);
void gimp_gegl_mode_node_set_mode (GeglNode *node,
- GimpLayerMode mode,
- gboolean linear);
+ GimpLayerMode mode);
void gimp_gegl_mode_node_set_opacity (GeglNode *node,
gdouble opacity);
+
void gimp_gegl_node_set_matrix (GeglNode *node,
const GimpMatrix3 *matrix);
void gimp_gegl_node_set_color (GeglNode *node,
diff --git a/app/gegl/gimpapplicator.c b/app/gegl/gimpapplicator.c
index efb1455..9d8dd16 100644
--- a/app/gegl/gimpapplicator.c
+++ b/app/gegl/gimpapplicator.c
@@ -106,7 +106,6 @@ gimp_applicator_get_property (GObject *object,
GimpApplicator *
gimp_applicator_new (GeglNode *parent,
- gboolean linear,
gboolean use_split_preview,
gboolean use_result_cache)
{
@@ -116,8 +115,6 @@ gimp_applicator_new (GeglNode *parent,
applicator = g_object_new (GIMP_TYPE_APPLICATOR, NULL);
- applicator->linear = linear;
-
if (parent)
applicator->node = g_object_ref (parent);
else
@@ -137,8 +134,7 @@ gimp_applicator_new (GeglNode *parent,
NULL);
gimp_gegl_mode_node_set_mode (applicator->mode_node,
- applicator->paint_mode,
- applicator->linear);
+ applicator->paint_mode);
gimp_gegl_mode_node_set_opacity (applicator->mode_node,
applicator->opacity);
@@ -458,8 +454,7 @@ gimp_applicator_set_mode (GimpApplicator *applicator,
{
applicator->paint_mode = paint_mode;
- gimp_gegl_mode_node_set_mode (applicator->mode_node,
- paint_mode, applicator->linear);
+ gimp_gegl_mode_node_set_mode (applicator->mode_node, paint_mode);
}
}
diff --git a/app/gegl/gimpapplicator.h b/app/gegl/gimpapplicator.h
index a185c14..18b5497 100644
--- a/app/gegl/gimpapplicator.h
+++ b/app/gegl/gimpapplicator.h
@@ -57,7 +57,6 @@ struct _GimpApplicator
gdouble opacity;
GimpLayerMode paint_mode;
- gboolean linear;
GeglNode *mode_node;
GimpComponentMask affect;
@@ -88,7 +87,6 @@ struct _GimpApplicatorClass
GType gimp_applicator_get_type (void) G_GNUC_CONST;
GimpApplicator * gimp_applicator_new (GeglNode *parent,
- gboolean linear,
gboolean use_split_preview,
gboolean use_result_cache);
diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c
index 2a66da4..6b6317b 100644
--- a/app/paint/gimppaintcore.c
+++ b/app/paint/gimppaintcore.c
@@ -34,6 +34,7 @@
#include "gegl/gimpapplicator.h"
#include "core/gimp.h"
+#include "core/gimp-layer-modes.h"
#include "core/gimp-utils.h"
#include "core/gimpchannel.h"
#include "core/gimpimage.h"
@@ -446,8 +447,7 @@ gimp_paint_core_start (GimpPaintCore *core,
if (paint_options->use_applicator)
{
- core->applicator = gimp_applicator_new (NULL, core->linear_mode,
- FALSE, FALSE);
+ core->applicator = gimp_applicator_new (NULL, FALSE, FALSE);
if (core->mask_buffer)
{
@@ -972,7 +972,7 @@ gimp_paint_core_paste (GimpPaintCore *core,
core->paint_buffer_y,
core->mask_x_offset,
core->mask_y_offset,
- core->linear_mode,
+ gimp_layer_mode_is_linear (paint_mode),
paint_mode);
if (core->comp_buffer)
@@ -980,12 +980,12 @@ gimp_paint_core_paste (GimpPaintCore *core,
mask_components_onto (src_buffer,
core->comp_buffer,
gimp_drawable_get_buffer (drawable),
- GEGL_RECTANGLE(core->paint_buffer_x,
- core->paint_buffer_y,
- width,
- height),
+ GEGL_RECTANGLE (core->paint_buffer_x,
+ core->paint_buffer_y,
+ width,
+ height),
gimp_drawable_get_active_mask (drawable),
- core->linear_mode);
+ gimp_layer_mode_is_linear (paint_mode));
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]