[gimp] app: rename gimp_gegl_node_set_layer_mode() to gimp_gegl_mode_node_set()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: rename gimp_gegl_node_set_layer_mode() to gimp_gegl_mode_node_set()
- Date: Fri, 18 May 2012 21:51:45 +0000 (UTC)
commit 83a728f492047d0887ed8b030e581ec1a89e4499
Author: Michael Natterer <mitch gimp org>
Date: Fri May 18 23:50:35 2012 +0200
app: rename gimp_gegl_node_set_layer_mode() to gimp_gegl_mode_node_set()
and have it set mode and opacity at the same time, so we don't reset
opacity each time we set the mode.
app/core/gimpdrawable.c | 10 ++++------
app/core/gimplayer.c | 17 +++++++++--------
app/gegl/gimp-gegl-nodes.c | 14 ++++++--------
app/gegl/gimp-gegl-nodes.h | 3 ++-
4 files changed, 21 insertions(+), 23 deletions(-)
---
diff --git a/app/core/gimpdrawable.c b/app/core/gimpdrawable.c
index f5be71b..b4cb768 100644
--- a/app/core/gimpdrawable.c
+++ b/app/core/gimpdrawable.c
@@ -946,12 +946,10 @@ gimp_drawable_sync_source_node (GimpDrawable *drawable,
"y", (gdouble) (fs_off_y - off_y),
NULL);
- gimp_gegl_node_set_layer_mode (drawable->private->fs_mode_node,
- gimp_layer_get_mode (fs), FALSE);
-
- gegl_node_set (drawable->private->fs_mode_node,
- "opacity", gimp_layer_get_opacity (fs),
- NULL);
+ gimp_gegl_mode_node_set (drawable->private->fs_mode_node,
+ gimp_layer_get_mode (fs),
+ gimp_layer_get_opacity (fs),
+ FALSE);
}
else
{
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index 5708b0e..64541a8 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -880,10 +880,7 @@ gimp_layer_get_node (GimpItem *item)
*/
mode_node = gimp_drawable_get_mode_node (drawable);
- gimp_gegl_node_set_layer_mode (mode_node, layer->mode, FALSE);
- gegl_node_set (mode_node,
- "opacity", layer->opacity,
- NULL);
+ gimp_gegl_mode_node_set (mode_node, layer->mode, layer->opacity, FALSE);
/* the layer's offset node */
layer->layer_offset_node = gegl_node_new_child (node,
@@ -1939,9 +1936,12 @@ gimp_layer_set_opacity (GimpLayer *layer,
if (gimp_item_peek_node (GIMP_ITEM (layer)))
{
- gegl_node_set (gimp_drawable_get_mode_node (GIMP_DRAWABLE (layer)),
- "opacity", layer->opacity,
- NULL);
+ GeglNode *mode_node;
+
+ mode_node = gimp_drawable_get_mode_node (GIMP_DRAWABLE (layer));
+
+ gimp_gegl_mode_node_set (mode_node,
+ layer->mode, layer->opacity, FALSE);
}
gimp_drawable_update (GIMP_DRAWABLE (layer),
@@ -1986,7 +1986,8 @@ gimp_layer_set_mode (GimpLayer *layer,
mode_node = gimp_drawable_get_mode_node (GIMP_DRAWABLE (layer));
- gimp_gegl_node_set_layer_mode (mode_node, layer->mode, FALSE);
+ gimp_gegl_mode_node_set (mode_node,
+ layer->mode, layer->opacity, FALSE);
}
gimp_drawable_update (GIMP_DRAWABLE (layer),
diff --git a/app/gegl/gimp-gegl-nodes.c b/app/gegl/gimp-gegl-nodes.c
index e99615c..d5f75a8 100644
--- a/app/gegl/gimp-gegl-nodes.c
+++ b/app/gegl/gimp-gegl-nodes.c
@@ -191,11 +191,7 @@ gimp_gegl_create_apply_buffer_node (GeglBuffer *buffer,
mode_node = gegl_node_new_child (node,
"operation", "gimp:normal-mode",
NULL);
- gimp_gegl_node_set_layer_mode (mode_node, mode, FALSE);
-
- gegl_node_set (mode_node,
- "opacity", opacity,
- NULL);
+ gimp_gegl_mode_node_set (mode_node, mode, opacity, FALSE);
gegl_node_connect_to (buffer_source, "output",
mode_node, "aux");
@@ -267,9 +263,10 @@ gimp_gegl_add_buffer_source (GeglNode *parent,
}
void
-gimp_gegl_node_set_layer_mode (GeglNode *node,
- GimpLayerModeEffects mode,
- gboolean premultiplied)
+gimp_gegl_mode_node_set (GeglNode *node,
+ GimpLayerModeEffects mode,
+ gdouble opacity,
+ gboolean premultiplied)
{
const gchar *operation = "gimp:normal-mode";
@@ -309,6 +306,7 @@ gimp_gegl_node_set_layer_mode (GeglNode *node,
gegl_node_set (node,
"operation", operation,
+ "opacity", opacity,
"premultiplied", premultiplied,
NULL);
}
diff --git a/app/gegl/gimp-gegl-nodes.h b/app/gegl/gimp-gegl-nodes.h
index 8fcbd0f..f79db82 100644
--- a/app/gegl/gimp-gegl-nodes.h
+++ b/app/gegl/gimp-gegl-nodes.h
@@ -46,8 +46,9 @@ GeglNode * gimp_gegl_add_buffer_source (GeglNode *parent,
gint offset_x,
gint offset_y);
-void gimp_gegl_node_set_layer_mode (GeglNode *node,
+void gimp_gegl_mode_node_set (GeglNode *node,
GimpLayerModeEffects mode,
+ gdouble opacity,
gboolean premultiplied);
void gimp_gegl_node_set_matrix (GeglNode *node,
const GimpMatrix3 *matrix);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]