1. 18 Mar, 2018 1 commit
    • Jehan's avatar
      app, libgimp, pdb: add "distance-metric" property to GimpPDBContext. · e164aee7
      Jehan authored
      This property is currently only used for gimp_edit_blend() to control
      how are computed distances. In the future, it could be used for more
      functions making use of "gegl:distance-transform" operation, or even for
      other algorithms, if relevant.
      This new property obviously comes with 2 new PDB calls:
      gimp_context_get_distance_metric() & gimp_context_set_distance_metric()
      e164aee7
  2. 17 Mar, 2018 4 commits
  3. 16 Mar, 2018 4 commits
    • Jehan's avatar
      app: return from gimp_display_shell_space_pressed() immediately when... · 8aaf77ba
      Jehan authored
      ... scrolling in progress.
      In particular, this could happen while panning with mouse middle click
      and hitting space. This space should simply be ignored.
      8aaf77ba
    • Jehan's avatar
      Bug 724692 - Canvas rotation stuck with specific order of actions. · b279c2d2
      Jehan authored
      The bug was affecting actually both canvas rotation and panning when
      done with space key. If the first mouse button was also clicked, then
      released after the space key, we ended up in some stuck action. It could
      only be unstuck by hitting/releasing space again.
      
      I am actually unsure that this was not originally done on purpose,
      especially since the code has these 2 status variables space_pressed and
      space_release_pending, but really apart from looking at this code, the
      behavior just looks very buggy and impracticable.
      The new behavior is to just stop the canvas panning/rotation as soon as
      space is released (which is also how it is documented in our manual, and
      how everyone seems to use the feature). I only kept the variable
      space_release_pending, which I use as was used space_pressed before.
      b279c2d2
    • Ell's avatar
      app: throttle GimpCanvasProgress updates · dc185204
      Ell authored
      Avoid redrawing GimpCanvasProgress items upon
      GimpProgress::set_value() if a minimal amount of time hasn't passed
      since the last call.  This notably improves performance of
      frequently-updated GimpCanvasProgress items.
      dc185204
    • Ell's avatar
      app: fix indentation in gimpcanvasprogress.c · 1cc90e52
      Ell authored
      1cc90e52
  4. 15 Mar, 2018 2 commits
    • Jehan's avatar
      app: don't sync Blend tool's gradient-repeat property with gimp:blend... · c403e472
      Jehan authored
      ... when gradient_type >= GIMP_GRADIENT_SHAPEBURST_ANGULAR.
      Our current GUI code for the Blend tool options disables the "Repeat"
      widget with any of the shaped and spiral gradient types, which means (I
      assume) no repeat mode is allowed on these gradients. Nevertheless it
      was possible to change the repeat mode in another gradient type, then
      switch to one of these and get the repeat processed even though the GUI
      shows insensitive.
      I could simply reset the repeat mode to GIMP_REPEAT_NONE when setting
      one of these gradient types, but I think you'd want the repeat to stay
      at its value (being insensitive is enough to mean whatever value is set
      is not taken into account). So instead, I just unsync this specific
      property when appropriate.
      Note also I don't do this in the gimp:blend operation code because I am
      not sure this specific behavior is meant to be a generic blend behavior
      or just relative to the tool (render of the shaped gradients is barely
      different with a repeat, but there is still a difference).
      c403e472
    • Jehan's avatar
      app: add "distance-metric" property to the Blend tool options. · 87330a77
      Jehan authored
      It seems old blend tool (from GIMP 2.8) was using manhattan distance,
      whereas the new one uses euclidean. I guess there must be use cases for
      both. In any case, it is a good idea to simply propose the option since
      the property exists in the "gegl:distance-transform" operation.
      See also bug 781621.
      87330a77
  5. 14 Mar, 2018 3 commits
    • Ell's avatar
      app, pdb, libgimp, plug-ins, menus: rename layer composite modes · a7f3a2dd
      Ell authored
      Our composite modes don't correspond directly to the Porter-Duff
      operators after which they're named, and these names aren't too
      descriptive anyway.
      
      Rename the composite modes as follows:
      
        Source Over       =>  Union
        Source Atop       =>  Clip to Backdrop
        Destination Atop  =>  Clip to Layer
        Source In         =>  Intersection
      
      Update relevant code, including UI text, enumerator names, function
      names, and action names.
      a7f3a2dd
    • Jehan's avatar
      app: check "gradient-repeat" sensitivity at Blend Options creation. · 11ce60ba
      Jehan authored
      When starting the tool with one of the gradient types for which the
      repeat option should be deactivated, it is not. Run the handler function
      once at GUI creation.
      Also compare the gradient type with an enum value, which makes the test
      clearer than using an int.
      11ce60ba
    • Jehan's avatar
      Bug 781621 - PDB shapeburst gradient is slower than the blend tool. · 5751bb11
      Jehan authored
      PDB function gimp_edit_blend() was based on "gimp:shapeburst" operation
      whereas the rest of GIMP (in particular, the Blend tool) used
      "gegl:distance-transform" which is much faster.
      Setting the operation to "manhattan" metric ensures that it still
      renders the same way as in 2.8 while being a lot faster.
      
      There was still a problem regarding as how it renders differently from
      the Blend tool, but it turns out that the Blend tool is the one
      rendering differently from how it used to in 2.8. We should discuss
      adding the "metric" property in the tool options.
      5751bb11
  6. 13 Mar, 2018 1 commit
    • Jehan's avatar
      app: disable multi-threading on "gimp:shapeburst" operation. · 6f127f9d
      Jehan authored
      This operation is currently broken on multi-thread. So disable
      multi-threading, at least temporarily (if not forever since apparently
      we can get similar output with "gegl:distance-transform", but much
      faster and nicer). See bug 781621.
      6f127f9d
  7. 10 Mar, 2018 1 commit
    • Ell's avatar
      app: fix #include order in gimp-spawn.c · b590b595
      Ell authored
      ... so that GLib is included before the platform-specific headers,
      so that we can check for G_OS_WIN32.
      
      Spotted by Partha, as usual :)
      b590b595
  8. 08 Mar, 2018 1 commit
  9. 07 Mar, 2018 12 commits
  10. 06 Mar, 2018 2 commits
    • Ell's avatar
      app, libgimp: don't close parent pipes in libgimp; use gimp_spawn_set_cloexec() · 1b1fba19
      Ell authored
      In gimp_plug_in_open(), use gimp_spawn_set_cloexec() to prevent the
      parent's end of the read/write pipes from being inherited by the
      spawned plug-in, instead of passing the corresponding file
      descriptors to the plug-in as command-line arguments, and having
      gimp_main() close them.
      
      Adding new command-line arguments to plug-ins is problematic, since
      their ability to handle them depends on their protocol version,
      which is only communicated after the plug-in is spawned.
      
      Regardless, this is much simpler.
      1b1fba19
    • Ell's avatar
      app: add gimp_spawn_set_cloexec() · cdb541f8
      Ell authored
      ... which prevents child processes from inheriting a given pipe,
      under *nix and Windows.
      cdb541f8
  11. 05 Mar, 2018 5 commits
    • Ell's avatar
      app: fix buffer overflow in gimp_plug_in_open() · c6e8dd88
      Ell authored
      Commit b9e629ab added two more
      command-line arguments when spawning plug-ins, but failed to expand
      the args array...
      c6e8dd88
    • Ell's avatar
      app: verify input argumets in gimp_spawn_async() · 95af9399
      Ell authored
      95af9399
    • Ell's avatar
      e1ed39e3
    • Ell's avatar
      app, libgimp: use gimp_spawn_async() when spawning plug-ins · b9e629ab
      Ell authored
      In gimp_plug_in_open(), use gimp_spawn_async(), added in the
      previous commit, instead of g_spawn_async().  See the previous
      commit for the rationale.
      
      Since gimp_spawn_async() doesn't provide a mechanism to perform any
      cleanup in the child before exec()ing, move the closing of the
      parent's end of the read/write pipes from the app to the plug-in's
      gimp_main(), passing the relevant file descriptors to the plug-in
      through argv.
      b9e629ab
    • Ell's avatar
      app: add gimp_spawn_async() · 0f2df18d
      Ell authored
      gimp_spawn_async() is similar to, but more limited than,
      g_spawn_sync().  Unlike the latter, gimp_spawn_async() uses
      vfork(), instead of fork(), when possible.
      
      On Linux, a process that uses large amounts of memory (as GIMP may)
      can hang during a fork() if overcommitting is enabled, and there's
      not enough memroy.  Using vfork() avoids that, since it doesn't
      duplicate the parent's address space.
      0f2df18d
  12. 04 Mar, 2018 1 commit
  13. 03 Mar, 2018 1 commit
    • Jehan's avatar
      Bug 794023 - Bad/Double free bugs found by scan-build. · c9d9b553
      Jehan authored
      In case of error in gimp_prop_eval_parse_reference(), we were obviously
      freeing the string which had just been allocated by g_strdup(), not the
      pointer to this string.
      Thanks to Massimo for raising this issue.
      c9d9b553
  14. 01 Mar, 2018 2 commits
    • Ell's avatar
      app: add custom GUI for gegl:recursive-transform · 8039582d
      Ell authored
      gegl:recursive-transform applies a transformation recursively to
      an image.  The custom GUI allows controlling the transformation
      matrix using a transform-grid controller, added in the previous
      commit.
      8039582d
    • Ell's avatar
      app: add transform-grid controller to prop-gui · 3985651d
      Ell authored
      ... which allows ops to create a transform-grid widget, similar to
      the unified-transform tool, which can be used to control a
      transformation matrix.
      
      Implement the transform-grid controller in GimpFilterTool.
      3985651d