1. 10 Apr, 2018 1 commit
    • Michael Natterer's avatar
      Bug 791519 - Unexpected selection from channel · 3f95dc52
      Michael Natterer authored
      Make sure a channel -> selection -> channel roundtrip never does any
      gamma conversion.
      In gimp_channel_duplicate(), make sure a created channel has the
      right format, and the right data. Fixes selection -> channel.
      When switching off quick mask, call gimp_item_to_selection() instead
      if gimp_selection_load(), the latter was implementing a shortcut which
      is now wrong.
      Remove gimp_selection_load() which is now unused.
      Unrelated: also remove gimp_selection_save(), it was an obvious
      3-liner used only twice.
  2. 09 Apr, 2018 5 commits
    • Michael Natterer's avatar
      Revert "Bug 791512 - make the selection boundary detection the same as 2.8" · bba8f695
      Michael Natterer authored
      This commit was fixing only a symptom of our channel/selection
      problem, making it appear things were fine.
      This reverts commit 27512d80.
    • Ell's avatar
      Bug 795081 - Crash when using a brush combined with a dynamics · f5cb1fed
      Ell authored
      In GimpPaintTool, brush outline generation took place during
      gimp_paint_tool_draw() even while painting.  This function is run
      concurrently with the paint thread.  When using dynamics, this
      introduced a race conidition between updating the brush mask in the
      paint thread, and updating the brush boundary in the main thread.
      Move brush outline generation during painting to
      gimppainttool-paint.c, and perform it in the display-update
      timeout, while the main thread and the paint thread are
    • Ell's avatar
      app: remove option for paint tools to opt out of a separate thread · e98506b0
      Ell authored
      After last commit, all paint tools work correctly with a separate
      paint thread, so we can remove the option for specific paint tools
      to opt out.  Particularly, GimpMybrushTool now uses a separate
      paint thread too.
      Note that the separate paint thread can still be disabled through
      the GIMP_NO_PAINT_THREAD environment variable.
    • Ell's avatar
      app: reorganize gimppaintool-paint · 2ae16ca6
      Ell authored
      Reorganize/clean up gimppainttool-paint.  In particular, move all
      paint-core interaction during painting to gimppainttool-paint.c, so
      that we can have more control over what's going on; specifically,
      enter the drawable into paint mode *before* starting the paint
      core, so that it picks up the correct buffer.  This fixes painting
      with the paint thread using GimpApplicator, and enables us to use
      the paint thread with GimpMybrushTool.
    • Jehan's avatar
      app: do not use gimp_filename_to_utf8() in the signal handler. · f77edcdf
      Jehan authored
      This function is unsafe during signal handling. And in any case, when
      printing to stderr, I don't think we need to convert to UTF-8. Quite the
      contrary, the system encoding may be more appropriate.
  3. 08 Apr, 2018 8 commits
    • luz.paz's avatar
      Bug 794996 - Misc. typo fixes in comments in app/ · 7fdb963e
      luz.paz authored
      Found via `codespell -q 3 --skip="./po*"`
    • Michael Natterer's avatar
      Bug 791519 - Unexpected selection from channel · 8994246b
      Michael Natterer authored
      One additional fix for the gimp-channel-combine-masks procedure,
      it needs both the combined *and* combined-to buffer in
      gimp_gegl_mask_combine_buffer() to be treated specially.
    • Michael Natterer's avatar
      Bug 791519 - Unexpected selection from channel · bb4ac7c8
      Michael Natterer authored
      Storing selections and layer masks as linear grayscale, but channels
      as whatever-the-layers-are caused severe problems in images with
      gamma-corrected layers: when combining channels with the selection,
      they would go thorugh a gamma conversion before being combined, giving
      unexpected results.
      This commit changes all channels to always be linear, except in 8-bit
      images, where they continue to be "Y' u8", for compatibility with old
      XCF files, and because linear 8-bit can't really be used in
      compositing (channels can be visible too).
      To fix channel -> selection combinations also for these images, add a
      small hack to gimp_gegl_mask_combine_buffer() which makes sure the
      to-be-combined channel's pixels are always read as-is, without any
      gamma conversion. After changing channels to linear, this makes no
      difference except in the 8-bit images where we need this hack.
    • Ell's avatar
      app: move painting to a separate thread · 8e7a3429
      Ell authored
      Add gimppainttool-paint.[ch], which takes care of painting during
      motion events in GimpPaintTool.  Perform the actual painting in a
      separate thread, so that display updates, which can have a
      significant synchronization overhead, don't stall painting.
      Allow specific paint tools to opt-out of a separate paint thread,
      and avoid it in GimpMybrushTool, since it doesn't seem to work.
      The separate paint thread can be explicitly disabled by setting the
      GIMP_NO_PAINT_THREAD environment variable.
    • Ell's avatar
      app: add gimp_drawable_{start,end,flush}_paint() · ce9ca03e
      Ell authored
      gimp_drawable_start/end_paint() are used to enter/exit paint mode
      for a given drawable.  While the drawable is in paint mode,
      gimp_drawable_get_buffer() returns a copy of the real drawable's
      buffer, referred to as the paint buffer, so that modifications to
      the returned buffer don't immediately affect the projection, and
      calls to gimp_drawable_update() queue the updated region, instead
      of emitting an "update" signal.
      gimp_drawable_flush_paint() can be called while the drawable is in
      paint mode, in order to copy the updated region of the paint buffer
      back to the drawable's real buffer, and to emit "update" signals
      for the queued region.
      We use these functions in the next commit, to move painting to a
      separate thread in the paint tools.
    • Ell's avatar
      app: align display paint area to a coarse grid · db50c72c
      Ell authored
      Align rectangles added to the display paint area, in
      gimp_display_paint_area(), to a coarse grid, to reduce the
      complexity of ther overall area.  This is similar to commit
      49285463, however the alignment
      happens in display space, instead of image space.
    • Thomas Manni's avatar
      Bug 794926 - Foreground select tool: several critical errors when ... · 440be880
      Thomas Manni authored
      ... double click during trimap painting
      Disable double click when the tool is in trimap paint state.
    • Ell's avatar
      Makefiles: don't use -xobjective-c when linking files on Mac · 6ebc3f1b
      Ell authored
      Last commit caused -xobjective-c to be passed during linking on
      Mac, causing object files to be treated as source files.  Add a
      -xnone flag to AM_LDFLAGS, canceling the effect of -xobjective-c.
      Additinally, add a -xobjective-c++ flag to AM_CXXFLAGS, so that we
      can use Objective-C in C++ files on Mac, if we ever need to.
  4. 07 Apr, 2018 5 commits
    • Ell's avatar
      Makefiles: don't use -xobjective-c when compiling C++ files on Mac · 06950be7
      Ell authored
      On Mac, pass -xobjective-c to the compiler through AM_CFLAGS, not
      AM_CPPFLAGS, so that it's only used for C sources, and not C++
      sources.  In the latter case, it clashes with the -std=... flag,
      spewing an error.  Thanks, Partha :)
    • Ell's avatar
      app: throttle statusbar progress updates · bea27171
      Ell authored
      Statusbar progress updates that update the progress bar are
      relatively expensive, slowing down operations that report progress
      frequently.  Only update the progress bar if a certain amount of
      time has passed since the last update, to counter that.
    • Ell's avatar
      Bug 795048 - Image->mode->Grayscale results in a black or transparent image · 87a10aaf
      Ell authored
      In gimp_gegl_convert_color_profile(), when src/dest_rect is NULL,
      use the extents of src/dest_buffer, instead of passing a NULL area
      to gimp_parallel_distribute_area(), which results in a CRITICAL.
      Additionally, only report progress on the main thread.
    • Massimo Valentini's avatar
      app: silence gcc warning · 81e1e396
      Massimo Valentini authored
      gimp-templates.c:143:15: warning: ‘strncpy’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]
                     strncpy (dpi, "ppi", 3);
    • Michael Natterer's avatar
      Bug 770424 - Themes: insensitive menu item are not readable · 2dd2f2f3
      Michael Natterer authored
      Need to check if we must override PixbufStyle's draw_layout() after
      each theme change, not only at the beginning of themes_init(), so it
      works also when the the pixbuf engine was not already loaded at
  5. 06 Apr, 2018 1 commit
  6. 05 Apr, 2018 8 commits
  7. 04 Apr, 2018 8 commits
    • Ell's avatar
      app: parallelize gimp-gegl-loops.cc · cb239e60
      Ell authored
    • Ell's avatar
      app: switch gimp-gegl-loops.c to C++ · 828b99b5
      Ell authored
    • Ell's avatar
      app: parallelize gimppaintcore-loops.cc · 3df757ff
      Ell authored
    • Ell's avatar
      app: switch gimppaintcore-loops.c to C++ · e8a14dee
      Ell authored
    • Ell's avatar
      app: parallelize gimpbrush-transform.cc · c8d4c079
      Ell authored
      Use gimp_parallel_distribute_foo() to parallelize the brush
      transform functions.
    • Ell's avatar
      app: switch gimpbrush-transform.c to C++ · 565f1f2a
      Ell authored
      The next commit is going to parallelize gimpbrush-transform using
      the gimp_parallel_distribute_foo() functions.  To spare us a lot of
      boilerplate code, we're going to use C++ lambdas as callback
      arguments to these functions.
      This commit does the initial conversion of gimpbrush-transform.c to
      C++, renaming it to gimpbrush-transform.cc.  We do this in a
      separate commit, so that the changes are small enough for git to
      register this as a renamed file, rather than a new file, so that we
      don't lose the file's history.
    • Ell's avatar
      app: add gimp-parallel · 86b89cf6
      Ell authored
      Add gimp-parallel.[cc,h], which provides a set of parallel
      These currently include:
        - gimp_parallel_distribute():  Calls a callback function in
          parallel on multiple threads, passing it the current thread
          index, and the total number of threads.  Allows specifying the
          maximal number of threads used.
        - gimp_parallel_distribute_range():  Splits a range of integers
          between multiple threads, passing the sub-range to a callback
          function.  Allows specifying the minimal sub-range size.
        - gimp_parallel_distribute_area():  Splits a rectangular area
          between multiple threads, passing the sub-area to a callback
          function.  Allows specifying the minimal sub-area.
      The callback function is passed using an appropriately-typed
      function pointer, and a user-data pointer.  Additionally, when used
      in a C++ file, each of the above functions has an overloaded
      template version, taking the callback through a generic parameter,
      without a user-data pointer, which allows using function objects.
    • Ell's avatar
  8. 03 Apr, 2018 4 commits