1. 02 Dec, 2018 1 commit
    • Ell's avatar
      app: in GimpPaintCore, align copied undo rect to tile grid · 861f356b
      Ell authored
      In gimp_paint_core_finish(), when copying the relevant region of
      the cached undo buffer into a new buffer, align the region to the
      buffer's tile grid, so that all copied tiles are COWed.  This
      avoids lag when finishing a stroke.
      861f356b
  2. 14 Nov, 2018 1 commit
  3. 18 Sep, 2018 1 commit
    • Ell's avatar
      app, libgimp*, modules: don't use g_type_class_add_private() ... · 3b0040c0
      Ell authored
      ... and G_TYPE_INSTANCE_GET_PRIVATE()
      
      g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
      deprecated in GLib 2.58.  Instead, use
      G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
      G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
      foo_get_instance_private() functions, all of which are available in
      the GLib versions we depend on.
      
      This commit only covers types registered using one of the
      G_DEFINE_FOO() macros (i.e., most types), but not types with a
      custom registration function, of which we still have a few -- GLib
      currently only provides a (non-deprecated) public API for adding a
      private struct using the G_DEFINE_FOO() macros.
      
      Note that this commit was 99% auto-generated (because I'm not
      *that* crazy :), so if there are any style mismatches... we'll have
      to live with them for now.
      3b0040c0
  4. 11 Sep, 2018 1 commit
    • Ell's avatar
      app: some cleanup in gimppaintcore-loops · 6c6a7514
      Ell authored
      In gimp_paint_core_loops_process(), initialize the iterator with
      sufficient room for the number of iterators used by the algorithm
      hierarchy, instead of a fixed number.
      
      Add an additional 'rect' parameter to the init_step() and
      process_rows() algorithm member functions, which receives the area
      of the currently-processed chunk, to be used instead of the
      iterator's ROI member.  This allows us to pass a NULL iterator to
      hierarchies that don't use an iterator, and avoid the stack-
      allocated iterator hack we used in this case (and which became even
      more problematic with the new iterator API).
      6c6a7514
  5. 10 Sep, 2018 5 commits
  6. 09 Aug, 2018 1 commit
  7. 21 Jul, 2018 1 commit
    • Michael Natterer's avatar
      Initial space invasion commit in GIMP · e09e563a
      Michael Natterer authored
      All babl formats now have a space equivalent to a color profile,
      determining the format's primaries and TRCs. This commit makes GIMP
      aware of this.
      
      libgimp:
      
      - enum GimpPrecision: rename GAMMA values to NON_LINEAR and keep GAMMA
        as deprecated aliases, add PERCEPTUAL values so we now have LINEAR,
        NON_LINEAR and PERCPTUAL for each encoding, matching the babl
        encoding variants RGB, R'G'B' and R~G~B~.
      
      - gimp_color_transform_can_gegl_copy() now returns TRUE if both
        profiles can return a babl space, increasing the amount of fast babl
        color conversions significantly.
      
      - TODO: no solution yet for getting libgimp drawable proxy buffers in
        the right format with space.
      
      plug-ins:
      
      - follow the GimpPrecision change.
      
      - TODO: everything else unchanged and partly broken or sub-optimal,
        like setting a new image's color profile too late.
      
      app:
      
      - add enum GimpTRCType { LINEAR, NON_LINEAR, PERCEPTUAL } as
        replacement for all "linear" booleans.
      
      - change gimp-babl functions to take babl spaces and GimpTRCType
        parameters and support all sorts of new perceptual ~ formats.
      
      - a lot of places changed in the early days of goat invasion didn't
        take advantage of gimp-babl utility functions and constructed
        formats manually. They all needed revisiting and many now use much
        simpler code calling gimp-babl API.
      
      - change gimp_babl_format_get_color_profile() to really extract a
        newly allocated color profile from the format, and add
        gimp_babl_get_builtin_color_profile() which does the same as
        gimp_babl_format_get_color_profile() did before. Visited all callers
        to decide whether they are looking for the format's actual profile,
        or for one of the builtin profiles, simplifying code that only needs
        builtin profiles.
      
      - drawables have a new get_space_api(), get_linear() is now get_trc().
      
      - images now have a "layer space" and an API to get it,
        gimp_image_get_layer_format() returns formats in that space.
      
      - an image's layer space is created from the image's color profile,
        change gimpimage-color-profile to deal with that correctly
      
      - change many babl_format() calls to babl_format_with_space() and take
        the space from passed formats or drawables
      
      - add function gimp_layer_fix_format_space() which replaces the
        layer's buffer with one that has the image's layer format, but
        doesn't change pixel values
      
      - use gimp_layer_fix_format_space() to make sure layers loaded from
        XCF and created by plug-ins have the right space when added to the
        image, because it's impossible to always assign the right space upon
        layer creation
      
      - "assign color profile" and "discard color profile" now require use
        of gimp_layer_fix_format_space() too because the profile is now
        embedded in all formats via the space.  Add
        gimp_image_assign_color_profile() which does all that and call it
        instead of a simple gimp_image_set_color_profile(), also from the
        PDB set-color-profile functions, which are essentially "assign" and
        "discard" calls.
      
      - generally, make sure a new image's color profile is set before
        adding layers to it, gimp_image_set_color_profile() is more than
        before considered know-what-you-are-doing API.
      
      - take special precaution in all places that call
        gimp_drawable_convert_type(), we now must pass a new_profile from
        all callers that convert layers within the same image (such as
        image_convert_type, image_convert_precision), because the layer's
        new space can't be determined from the image's layer format during
        the call.
      
      - change all "linear" properties to "trc", in all config objects like
        for levels and curves, in the histogram, in the widgets. This results
        in some GUI that now has three choices instead of two.
        TODO: we might want to reduce that back to two later.
      
      - keep "linear" boolean properties around as compat if needed for file
        pasring, but always convert the parsed parsed boolean to
        GimpTRCType.
      
      - TODO: the image's "enable color management" switch is currently
        broken, will fix that in another commit.
      e09e563a
  8. 15 Jul, 2018 1 commit
    • Ell's avatar
      app: fix line-angle constraint when xres != yres · 4fefab17
      Ell authored
      Fix gimp_constrain_line() and friends to properly constrain line
      angles when the image's horizontal and vertical resolutions are
      different, and dot-for-dot is disabled.
      4fefab17
  9. 12 Jul, 2018 1 commit
  10. 11 Jul, 2018 1 commit
  11. 06 Jul, 2018 1 commit
  12. 29 Jun, 2018 1 commit
  13. 25 Jun, 2018 1 commit
    • Michael Natterer's avatar
      Issue #1714 - When GIMP starts, default brush hardness is always at 100 · cb0e6c65
      Michael Natterer authored
      We should not have essential signal connections (such as setting tool
      options from brush properties) implemented in the tool options GUI
      files, because they are not active until the options GUI is created.
      Also, that magic is simply too hidden in the options GUI files.
      
      Move the signal connections and the brush property copying code to
      gimppaintoptions.c where is can also be done cleaner.
      
      However, this must only be done for the main tool options instance
      that is used for the GUI. Therefore, add a "gui_mode" boolean to
      GimpToolOptions and set it to TRUE for all main tool options.
      
      (this is ugly, but much less ugly and much less hidden than all the
      places where code lives (like tool_manager.c) that can now be moved
      into GimpToolOptions and its subclasses, and implemented cleanly
      there).
      cb0e6c65
  14. 21 Jun, 2018 1 commit
  15. 17 Jun, 2018 1 commit
    • Ell's avatar
      Issue #1668 -- Smudge Tool - Wrong colors when painting on an image ... · 5a07876c
      Ell authored
      ... with a color profile other than the gimp built-in.
      
      When initializing the smude tool's accum buffer, use
      gimp_pickable_get_pixel_at(), instead of
      gimp_pickable_get_color_at(), for picking the initial color to fill
      the buffer with, so that we don't erroneously apply the image's
      color tranform to it when the image has a profile.  Previously,
      this would result in wrong colors when painting from the drawable
      edges inward, with flow < 100%.
      5a07876c
  16. 01 Jun, 2018 1 commit
  17. 25 May, 2018 1 commit
  18. 20 May, 2018 1 commit
    • Jehan's avatar
      app: extended device concept does not seem to exist in GTK+3. · 24d0886f
      Jehan authored
      We were keeping around a flag telling us if coordinates are extended or
      not. In GTK+2, a device indeed had to be enabled. In GTK+3, I can see
      that device with extended inputs are enabled by default (they always
      have pressure, etc.). This flag is made useless.
      24d0886f
  19. 16 May, 2018 1 commit
    • Ell's avatar
      Bug 796153 - Airbrush doesn't paint on timeout, and crashes with dynamics · 23dab431
      Ell authored
      gimp_airbrush_stamp(), which is called during the airbrush timeout
      to periodically stamp the airbrush, assumes the saved symmetry's
      origin is the same as during the original call to
      gimp_airbrush_paint().  However, since commit
      bc09c718, we clear the symmetry's
      origin at the end of gimp_paint_core_paint(), resulting in an empty
      symmetry with a NULL origin during gimp_airbrush_stamp().  As a
      result, no dab is painted, and we segfault if there's active
      dynamics.
      
      Fix this by saving the symmetry's origin coords during
      gimp_airbrush_paint(), and restoring them in gimp_airbrush_stamp().
      23dab431
  20. 08 May, 2018 1 commit
    • Ell's avatar
      Bug 795909 - Multiple images opened with floating selection ... · bc09c718
      Ell authored
      ... closing one of them crashes GIMP
      
      GimpSymmetry keeps a strong reference to the drawable passed to
      gimp_symmetry_set_origin() until the next call to set_origin(), or
      until it's destroyed.  This can unnecessarily extend the lifetime
      of the drawable.  In particular, it can extend the lifetime of a
      floating selection past the destruction of the image mask, during
      image destruction, which results in a NULL mask pointer in
      gimp_layer_invalidate_boundary(), called when detaching the
      floating selection as part of its destructor.
      
      Add gimp_symmetry_clear_origin(), which clears the origin set using
      gimp_symmetry_set_origin(), dropping the reference to the drawable,
      and call it in gimp_paint_core_paint() after painting.  This avoids
      extending the lifetime of the drawable, and fixes the bug.
      bc09c718
  21. 25 Apr, 2018 1 commit
  22. 19 Apr, 2018 1 commit
    • Ell's avatar
      app: refactor gimppaintcore-loops to coalesce iteration · f2a1fd5b
      Ell authored
      The gimppaintcore-loops functions perform very little actual
      computational work (in case of do_layer_blend(), at least for
      simple blend modes), which makes the cost of buffer iteration, and
      memory bandwidth, nonnegligible factors.  Since these functions are
      usually called in succession, acessing the same region of the same
      buffers, using the same foramts, coalescing them into a single
      function, which performs all the necessary processing in a single
      step, can improve performance when these functions are the
      bottleneck.
      
      Add a gimp_paint_core_loops_process() function, which does just
      that: it takes a set of algorithms to run, and a set of parameters,
      and performs all of them in one go.  The individual functions are
      kept for convenience, but are merely wrappers around
      gimp_paint_core_loops_process().
      
      Be warned: the implementation uses unholy C++ from outer space, in
      order to make this (sort of) managable.  See the comments for more
      details.
      f2a1fd5b
  23. 18 Apr, 2018 1 commit
    • Ell's avatar
      app: fix airbrush periodic stamp behavior · 542a0473
      Ell authored
      Commit ddfc7715 changed the
      airbrush periodic stamp behavior, so that instead of using the main
      brush, it issued a full MOTION event, potentially using a different
      brush when using a GIH brush.
      
      Fix this, by renaming the "timeout" signal of GimpAirbrush to
      "stamp", and by adding a new gimp_airbrush_stamp() function, which
      should be used for painting the periodic airbrush dab in response,
      instead of calling gimp_paint_core_paint() directly, and which
      calls gimp_airbrush_paint() instead, as the old code did.
      
      In order to call this function from the paint thread, we replace
      the various gimp_paint_tool_paint_core_foo() functions, introduced
      in the above commit, with a generic gimp_paint_tool_paint_push()
      function, which takes a callback (and a data pointer) to run on the
      paint thread, and queues it for execution (when not using the paint
      thread, the function is called directly from the calling thread.)
      542a0473
  24. 16 Apr, 2018 1 commit
    • Ell's avatar
      app: make the airbrush tool thread-safe w.r.t. paint thread · ddfc7715
      Ell authored
      GimpAirbrush currently performs painting and flushes the image on
      its own during the airbrush timeout.  This is unsafe w.r.t. the
      paint thread, since the timeout is run on the main thread, while
      paint commands should run on the paint thread.
      
      Add a "timeout" signal to GimpAirbrush, and simply emit this signal
      during the airbrush timeout, rather than actually painting.
      
      Connect to this signal in GimpAirbrushTool, and use
      gimppaintool-paint to perform the actual painting, in a thread-safe
      manner (see the previous commit.)
      ddfc7715
  25. 13 Apr, 2018 3 commits
  26. 11 Apr, 2018 1 commit
    • Jehan's avatar
      Bug 768872 - Tiling Symmetry doesn't wrap vertical coordinates over... · 1993d8a4
      Jehan authored
      ... edges for MyPaint brush.
      
      Adding the concept of "stateful" symmetry when a tool needs to make sure
      of corresponding stroke numbers and orders while painting (i.e. stroke N
      at time T+1 is the continuation of stroke N at time T). This is the case
      for the MyPaint brushes and the ink tool.
      1993d8a4
  27. 08 Apr, 2018 1 commit
  28. 05 Apr, 2018 5 commits
  29. 04 Apr, 2018 2 commits