Commit 265dfec5 authored by Michael Natterer's avatar Michael Natterer 😴

app: split GimpApplicator's opacity and mode API into two functions

Added gimp_applicator_set_opacity() and remove the opacity argument
from set_mode().
parent 1c6b85d0
......@@ -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));
......
......@@ -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));
......
......@@ -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);
}
......
......@@ -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,
......
......@@ -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)
{
......
......@@ -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);
......
......@@ -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,
......
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