Commit 660f53d3 authored by Ell's avatar Ell

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.
parent dd8268c0
...@@ -55,24 +55,25 @@ static gboolean ...@@ -55,24 +55,25 @@ static gboolean
gimp_drawable_edit_can_fill_direct (GimpDrawable *drawable, gimp_drawable_edit_can_fill_direct (GimpDrawable *drawable,
GimpFillOptions *options) GimpFillOptions *options)
{ {
GimpImage *image; GimpImage *image;
GimpContext *context; GimpContext *context;
gdouble opacity; gdouble opacity;
GimpLayerMode mode; GimpLayerMode mode;
GimpLayerCompositeMode composite_mode; GimpLayerCompositeMode composite_mode;
GimpLayerCompositeRegion composite_region;
image = gimp_item_get_image (GIMP_ITEM (drawable));
context = GIMP_CONTEXT (options); image = gimp_item_get_image (GIMP_ITEM (drawable));
opacity = gimp_context_get_opacity (context); context = GIMP_CONTEXT (options);
mode = gimp_context_get_paint_mode (context); opacity = gimp_context_get_opacity (context);
composite_mode = gimp_layer_mode_get_paint_composite_mode (mode); 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)) && if (gimp_channel_is_empty (gimp_image_get_mask (image)) &&
opacity == GIMP_OPACITY_OPAQUE && opacity == GIMP_OPACITY_OPAQUE &&
gimp_layer_mode_is_trivial (mode) && gimp_layer_mode_is_trivial (mode) &&
(gimp_layer_mode_is_subtractive (mode) || (! gimp_layer_mode_is_subtractive (mode) ^
(gimp_layer_mode_get_included_region (mode, composite_mode) & ! (composite_region & GIMP_LAYER_COMPOSITE_REGION_SOURCE)))
GIMP_LAYER_COMPOSITE_REGION_SOURCE)))
{ {
gboolean source_has_alpha = FALSE; gboolean source_has_alpha = FALSE;
......
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