[gimp] app: in gimp_paint_core_paste(), don't copy paint mask when combining to canvas buffer
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: in gimp_paint_core_paste(), don't copy paint mask when combining to canvas buffer
- Date: Tue, 12 Feb 2019 14:31:01 +0000 (UTC)
commit ba6713bbe1cffc1a68fe9e3ee2b3da51e1d30e50
Author: Ell <ell_se yahoo com>
Date: Tue Feb 12 06:43:01 2019 -0500
app: in gimp_paint_core_paste(), don't copy paint mask when combining to canvas buffer
In the applicator path of gimp_paint_core_paste(), use the paint
mask directly when combining it to the canvas buffer, rather than
using a copy of it, since it's not being modified.
Fix some comments.
app/paint/gimppaintcore.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/app/paint/gimppaintcore.c b/app/paint/gimppaintcore.c
index 6acc6063ba..511761d631 100644
--- a/app/paint/gimppaintcore.c
+++ b/app/paint/gimppaintcore.c
@@ -793,7 +793,7 @@ gimp_paint_core_paste (GimpPaintCore *core,
if (core->applicator)
{
/* If the mode is CONSTANT:
- * combine the canvas buf, the paint mask to the canvas buffer
+ * combine the canvas buffer and the paint mask to the paint buffer
*/
if (mode == GIMP_PAINT_CONSTANT)
{
@@ -802,9 +802,8 @@ gimp_paint_core_paste (GimpPaintCore *core,
*/
if (paint_mask != NULL)
{
- GimpTempBuf *modified_mask = gimp_temp_buf_copy (paint_mask);
- GeglBuffer *paint_mask_buffer =
- gimp_temp_buf_create_buffer ((GimpTempBuf *) modified_mask);
+ GeglBuffer *paint_mask_buffer =
+ gimp_temp_buf_create_buffer ((GimpTempBuf *) paint_mask);
gimp_gegl_combine_mask_weird (paint_mask_buffer,
GEGL_RECTANGLE (paint_mask_offset_x,
@@ -818,7 +817,6 @@ gimp_paint_core_paste (GimpPaintCore *core,
GIMP_IS_AIRBRUSH (core));
g_object_unref (paint_mask_buffer);
- gimp_temp_buf_unref (modified_mask);
}
gimp_gegl_apply_mask (core->canvas_buffer,
@@ -833,7 +831,7 @@ gimp_paint_core_paste (GimpPaintCore *core,
core->undo_buffer);
}
/* Otherwise:
- * combine the canvas buf and the paint mask to the canvas buf
+ * combine the paint mask to the paint buffer directly
*/
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]