[gimp] app: fix drawable direct-fill criterion
- From: Ell <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: fix drawable direct-fill criterion
- Date: Sun, 2 Dec 2018 08:34:28 +0000 (UTC)
commit 660f53d300426ee9cb8bae178c2cfef166f5c164
Author: Ell <ell_se yahoo com>
Date: Sun Dec 2 03:22:41 2018 -0500
app: fix drawable direct-fill criterion
Don't use a direct-buffer fill if the mode is subtractive, and the
composite region includes the source. Currently, this never
actually happens.
app/core/gimpdrawable-edit.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
---
diff --git a/app/core/gimpdrawable-edit.c b/app/core/gimpdrawable-edit.c
index b6bd153eeb..ff5c233422 100644
--- a/app/core/gimpdrawable-edit.c
+++ b/app/core/gimpdrawable-edit.c
@@ -55,24 +55,25 @@ static gboolean
gimp_drawable_edit_can_fill_direct (GimpDrawable *drawable,
GimpFillOptions *options)
{
- GimpImage *image;
- GimpContext *context;
- gdouble opacity;
- GimpLayerMode mode;
- GimpLayerCompositeMode composite_mode;
-
- image = gimp_item_get_image (GIMP_ITEM (drawable));
- context = GIMP_CONTEXT (options);
- opacity = gimp_context_get_opacity (context);
- mode = gimp_context_get_paint_mode (context);
- composite_mode = gimp_layer_mode_get_paint_composite_mode (mode);
+ GimpImage *image;
+ GimpContext *context;
+ gdouble opacity;
+ GimpLayerMode mode;
+ GimpLayerCompositeMode composite_mode;
+ GimpLayerCompositeRegion composite_region;
+
+ image = gimp_item_get_image (GIMP_ITEM (drawable));
+ context = GIMP_CONTEXT (options);
+ opacity = gimp_context_get_opacity (context);
+ mode = gimp_context_get_paint_mode (context);
+ composite_mode = gimp_layer_mode_get_paint_composite_mode (mode);
+ composite_region = gimp_layer_mode_get_included_region (mode, composite_mode);
if (gimp_channel_is_empty (gimp_image_get_mask (image)) &&
opacity == GIMP_OPACITY_OPAQUE &&
gimp_layer_mode_is_trivial (mode) &&
- (gimp_layer_mode_is_subtractive (mode) ||
- (gimp_layer_mode_get_included_region (mode, composite_mode) &
- GIMP_LAYER_COMPOSITE_REGION_SOURCE)))
+ (! gimp_layer_mode_is_subtractive (mode) ^
+ ! (composite_region & GIMP_LAYER_COMPOSITE_REGION_SOURCE)))
{
gboolean source_has_alpha = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]