[gimp] app: split GimpApplicator's opacity and mode API into two functions
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: split GimpApplicator's opacity and mode API into two functions
- Date: Wed, 18 May 2016 07:48:31 +0000 (UTC)
commit 265dfec5253598eba12e8f899558613945ecf6d3
Author: Michael Natterer <mitch gimp org>
Date: Wed May 18 01:51:09 2016 +0200
app: split GimpApplicator's opacity and mode API into two functions
Added gimp_applicator_set_opacity() and remove the opacity argument
from set_mode().
app/core/gimpdrawable-combine.c | 3 ++-
app/core/gimpdrawable.c | 3 ++-
app/core/gimpdrawablefilter.c | 3 ++-
app/core/gimpimage-merge.c | 5 ++---
app/gegl/gimpapplicator.c | 16 +++++++++++-----
app/gegl/gimpapplicator.h | 5 +++--
app/paint/gimppaintcore.c | 4 ++--
7 files changed, 24 insertions(+), 15 deletions(-)
---
diff --git a/app/core/gimpdrawable-combine.c b/app/core/gimpdrawable-combine.c
index d89bf50..5190483 100644
--- a/app/core/gimpdrawable-combine.c
+++ b/app/core/gimpdrawable-combine.c
@@ -141,7 +141,8 @@ gimp_drawable_real_apply_buffer (GimpDrawable *drawable,
base_x - buffer_region->x,
base_y - buffer_region->y);
- gimp_applicator_set_mode (applicator, opacity, mode);
+ gimp_applicator_set_opacity (applicator, opacity);
+ gimp_applicator_set_mode (applicator, mode);
gimp_applicator_set_affect (applicator,
gimp_drawable_get_active_mask (drawable));
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index ded4d5a..8ce84d4 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -1042,8 +1042,9 @@ gimp_drawable_sync_fs_filter (GimpDrawable *drawable,
-off_x, -off_y);
}
+ gimp_applicator_set_opacity (private->fs_applicator,
+ gimp_layer_get_opacity (fs));
gimp_applicator_set_mode (private->fs_applicator,
- gimp_layer_get_opacity (fs),
gimp_layer_get_mode (fs));
gimp_applicator_set_affect (private->fs_applicator,
gimp_drawable_get_active_mask (drawable));
diff --git a/app/core/gimpdrawablefilter.c b/app/core/gimpdrawablefilter.c
index 4519de2..ccf50c2 100644
--- a/app/core/gimpdrawablefilter.c
+++ b/app/core/gimpdrawablefilter.c
@@ -530,8 +530,9 @@ gimp_drawable_filter_sync_preview (GimpDrawableFilter *filter,
static void
gimp_drawable_filter_sync_mode (GimpDrawableFilter *filter)
{
+ gimp_applicator_set_opacity (filter->applicator,
+ filter->opacity);
gimp_applicator_set_mode (filter->applicator,
- filter->opacity,
filter->paint_mode);
}
diff --git a/app/core/gimpimage-merge.c b/app/core/gimpimage-merge.c
index 60ed08b..b73eddc 100644
--- a/app/core/gimpimage-merge.c
+++ b/app/core/gimpimage-merge.c
@@ -639,9 +639,8 @@ gimp_image_merge_layers (GimpImage *image,
- (x1 - off_x),
- (y1 - off_y));
- gimp_applicator_set_mode (applicator,
- gimp_layer_get_opacity (layer),
- mode);
+ gimp_applicator_set_opacity (applicator, gimp_layer_get_opacity (layer));
+ gimp_applicator_set_mode (applicator, mode);
gimp_applicator_blit (applicator,
GEGL_RECTANGLE (0, 0,
diff --git a/app/gegl/gimpapplicator.c b/app/gegl/gimpapplicator.c
index 2eb5580..13558b8 100644
--- a/app/gegl/gimpapplicator.c
+++ b/app/gegl/gimpapplicator.c
@@ -107,7 +107,7 @@ gimp_applicator_get_property (GObject *object,
GimpApplicator *
gimp_applicator_new (GeglNode *parent,
gboolean linear,
- gboolean use_preview_cache,
+ gboolean use_split_preview,
gboolean use_result_cache)
{
GimpApplicator *applicator;
@@ -160,7 +160,7 @@ gimp_applicator_new (GeglNode *parent,
applicator->dup_apply_buffer_node,
NULL);
- if (use_preview_cache)
+ if (use_split_preview)
{
applicator->preview_cache_node =
gegl_node_new_child (applicator->node,
@@ -434,9 +434,8 @@ gimp_applicator_set_apply_offset (GimpApplicator *applicator,
}
void
-gimp_applicator_set_mode (GimpApplicator *applicator,
- gdouble opacity,
- GimpLayerModeEffects paint_mode)
+gimp_applicator_set_opacity (GimpApplicator *applicator,
+ gdouble opacity)
{
g_return_if_fail (GIMP_IS_APPLICATOR (applicator));
@@ -447,6 +446,13 @@ gimp_applicator_set_mode (GimpApplicator *applicator,
gimp_gegl_mode_node_set_opacity (applicator->mode_node,
opacity);
}
+}
+
+void
+gimp_applicator_set_mode (GimpApplicator *applicator,
+ GimpLayerModeEffects paint_mode)
+{
+ g_return_if_fail (GIMP_IS_APPLICATOR (applicator));
if (applicator->paint_mode != paint_mode)
{
diff --git a/app/gegl/gimpapplicator.h b/app/gegl/gimpapplicator.h
index 8983094..03c841e 100644
--- a/app/gegl/gimpapplicator.h
+++ b/app/gegl/gimpapplicator.h
@@ -89,7 +89,7 @@ GType gimp_applicator_get_type (void) G_GNUC_CONST;
GimpApplicator * gimp_applicator_new (GeglNode *parent,
gboolean linear,
- gboolean use_preview_cache,
+ gboolean use_split_preview,
gboolean use_result_cache);
void gimp_applicator_set_src_buffer (GimpApplicator *applicator,
@@ -109,8 +109,9 @@ void gimp_applicator_set_apply_offset (GimpApplicator *applicator,
gint apply_offset_x,
gint apply_offset_y);
+void gimp_applicator_set_opacity (GimpApplicator *applicator,
+ gdouble opacity);
void gimp_applicator_set_mode (GimpApplicator *applicator,
- gdouble opacity,
GimpLayerModeEffects paint_mode);
void gimp_applicator_set_affect (GimpApplicator *applicator,
GimpComponentMask affect);
diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c
index 1539b01..ac39c82 100644
--- a/app/paint/gimppaintcore.c
+++ b/app/paint/gimppaintcore.c
@@ -898,8 +898,8 @@ gimp_paint_core_paste (GimpPaintCore *core,
core->paint_buffer_x,
core->paint_buffer_y);
- gimp_applicator_set_mode (core->applicator,
- image_opacity, paint_mode);
+ gimp_applicator_set_opacity (core->applicator, image_opacity);
+ gimp_applicator_set_mode (core->applicator, paint_mode);
/* apply the paint area to the image */
gimp_applicator_blit (core->applicator,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]