[gimp/gimp-2-10] app: another fix to drawable direct-fill criterion



commit 98bf8319b6980827cb8612f075bc9b538f0af015
Author: Ell <ell_se yahoo com>
Date:   Sun Dec 2 03:41:16 2018 -0500

    app: another fix to drawable direct-fill criterion
    
    Don't use a direct-buffer fill when filling using a pattern with
    alpha, even when the mode is subtractive.
    
    (cherry picked from commit 42b82419b17d56e4fb15400a5ce1a50a2701efa3)

 app/core/gimpdrawable-edit.c | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/app/core/gimpdrawable-edit.c b/app/core/gimpdrawable-edit.c
index ff5c233422..d63b4a50f7 100644
--- a/app/core/gimpdrawable-edit.c
+++ b/app/core/gimpdrawable-edit.c
@@ -75,21 +75,24 @@ gimp_drawable_edit_can_fill_direct (GimpDrawable    *drawable,
       (! gimp_layer_mode_is_subtractive (mode)            ^
        ! (composite_region & GIMP_LAYER_COMPOSITE_REGION_SOURCE)))
     {
-      gboolean source_has_alpha = FALSE;
-
-      if (gimp_fill_options_get_style (options) == GIMP_FILL_STYLE_PATTERN &&
-          ! gimp_layer_mode_is_subtractive (mode))
+      switch (gimp_fill_options_get_style (options))
         {
-          GimpPattern *pattern;
-          const Babl  *format;
+        case GIMP_FILL_STYLE_SOLID:
+          return TRUE;
 
-          pattern = gimp_context_get_pattern (context);
-          format  = gimp_temp_buf_get_format (gimp_pattern_get_mask (pattern));
+        case GIMP_FILL_STYLE_PATTERN:
+          {
+            GimpPattern *pattern;
+            GimpTempBuf *mask;
+            const Babl  *format;
 
-          source_has_alpha = babl_format_has_alpha (format);
-        }
+            pattern = gimp_context_get_pattern (context);
+            mask    = gimp_pattern_get_mask (pattern);
+            format  = gimp_temp_buf_get_format (mask);
 
-      return ! source_has_alpha;
+            return ! babl_format_has_alpha (format);
+          }
+        }
     }
 
   return FALSE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]