1. 11 Sep, 2019 2 commits
    • Ell's avatar
      Issue #3781 - Display artifacts on HiDPI when render cache is invalidated · d710e96d
      Ell authored
      In GimpDisplayShell, scale the render cache by the window's scale
      factor, and render its content in device pixels, instead of scaled
      application pixels.  When painting the cache to the screen, unscale
      the cairo context by the same factor, so that it's painted in the
      native resolution.  Note that the various
      gimp_display_shell_render_foo() functions still speak in
      application pixels, and the scaling happens internally in
      gimp_display_shell_render().
      
      Aside from rendering at native resolution on HiDPI, this also fixes
      an issue where grid-like display artifacts would appear when the
      render cache was not fully validated due to the non-native scaling.
      d710e96d
    • Salamandar's avatar
      Meson port. · 65eff6f1
      Salamandar authored
      65eff6f1
  2. 10 Sep, 2019 2 commits
    • Ell's avatar
      app: fix CRITICAL in GimpNavigationEditor · 1b3c1fb9
      Ell authored
      ... after commit 2c9a8a56.  Don't
      use the same function as a handler for GimpContext::display-changed
      and GimpContext::image-changed -- their signatures are different.
      1b3c1fb9
    • Ell's avatar
      app: clear navigation editor when last image is closed · 2c9a8a56
      Ell authored
      In GimpNavigationEditor, make sure to clear the editor's shell when
      the last image is closed, even though the corresponding display is
      stil alive, so that we don't needlessly extend the lifetime of the
      image.  This is necessary after the recent GimpImageViewable
      changes, since the editor now (indirectly) holds a reference on the
      image.
      2c9a8a56
  3. 09 Sep, 2019 1 commit
  4. 05 Sep, 2019 2 commits
  5. 04 Sep, 2019 11 commits
    • Ell's avatar
      app: add support for show-all mode in GimpCanvasPassePartout · 32dd8d2d
      Ell authored
      Don't clip the outer rect to the size of the canvas in show-all
      mode.
      32dd8d2d
    • Ell's avatar
      app: add support for show-all mode in GimpCanvasGrid · 1e621680
      Ell authored
      Don't crop the grid to the canvas size in show-all mode.
      1e621680
    • Ell's avatar
      app: add gimp_canvas_item_untransform_viewport() · 23617c94
      Ell authored
      ... which untransforms the viewport from display space to the
      item's coordinate space (i.e., scaled and translated image space).
      23617c94
    • Ell's avatar
      app: add support for color picking in "show all" mode · cf363839
      Ell authored
      Add a show_all parameter to gimp_image_pick_color(), which, when
      TRUE, allows picking colors outside the canvas bounds in sample-
      merged mode.  Forward the display's "show all" mode through this
      parameter where applicable (in particular, in the color-picker tool
      and the pointer dockable).
      cf363839
    • Ell's avatar
      app: fix out-of-bounds rendering when alpha channel is invisible · da701ffc
      Ell authored
      When the image's alpha channel is invisible, paint regions outside
      the image contents as black, instead of using a checkboard pattern.
      This is especially notable when viewing the image in "show all"
      mode.
      da701ffc
    • Ell's avatar
      app: show full image contents in GimpNavigationEditor · a33f5498
      Ell authored
      In GimpNavigation{Editor,View}, show the full image contents when
      the corresponding display is in "show all" mode.  Additionally,
      when the display's "show canvas boundary" is active, show the
      canvas boundary in the navigation view as well.
      a33f5498
    • Ell's avatar
      app, menus: add "show canvas boundary" display option · e2f31852
      Ell authored
      Add a "show canvas boundary" display option, and a corresponding
      "View" menu item and default-apperance preferences option.  When
      enabled (the default), the canvas boundary is shown as an orange/
      black dashed line in "show all" mode.
      e2f31852
    • Ell's avatar
      app: improve display scroll/zoom-related behavior in "show all" mode · a1717a90
      Ell authored
      In "show all" mode, the image is thought to be "infinite"; this
      commit improves the overall scrolling/zooming behavior in this mode
      according to this assumption.  In cases where a specific image size
      is needed (e.g., for the scrollbar bounds, fit-image-in-window,
      etc.), the image's full bounding box is used; however, in cases
      where a center point is needed (e.g., for the zoomed-out scrollbar
      bounds, center-image-in-window), the canvas center, rather than the
      bounding-box center, is still used.
      a1717a90
    • Ell's avatar
      app: add "clip" parameter to gimp_display_shell_untransform_viewport() · 788b136b
      Ell authored
      ... which specifies whether to clip the viewport to the canvas
      (previously, it would always be clipped).  Use the appropriate
      value in all callers, depending on the shell's "show all" mode.  In
      particular, this commit avoids clipping the image projection's
      priority rect to the canvas in "show all" mode.
      788b136b
    • Ell's avatar
      app, menus: add "show all" mode to GimpDisplayShell; "View -> Show All" toggle · 86dc451b
      Ell authored
      Add a "show all" mode to GimpDisplayShell, controlled through a
      corresponding "View -> Show All" menu item.  When enabled, the
      entire image content is displayed, instead of cropping the image
      to the canvas size.  More generally, the display behaves as if the
      canvas were infinite.  The following commits improve the overall
      behavior in this mode.
      
      Add a prefernces option to control the default "show all" state.
      86dc451b
    • Michael Natterer's avatar
      app: split GimpDisplay in two classes: GimpDisplay and GimpDisplayImpl · b92dd2c8
      Michael Natterer authored
      GimpDisplay contains only the ID logic and the "gimp" and "config"
      pointers, and lives in the core.
      
      GimpDisplayImpl is a subclass and contains all the actual display
      stuff. The subclass is only an implementation detail and doesn't
      appear in any API.
      
      Remove all hacks which pass displays as gpointer, GObject or
      GimpObject through the core, or even lookup its type by name,
      just use GimpDisplay.
      b92dd2c8
  6. 23 Aug, 2019 1 commit
  7. 17 Aug, 2019 1 commit
  8. 10 Aug, 2019 2 commits
  9. 09 Aug, 2019 1 commit
  10. 03 Aug, 2019 3 commits
    • Niels De Graef's avatar
      Add (nullable) if applicable · 5f92ced1
      Niels De Graef authored
      Basically this commit makes sure that all return values that are marked
      as "Returns:" also have a `(nullable)` annotation if it is mentioned on
      the same line that NULL can also be returned.
      
      This will prevent a few problems in GObject-introspection.
      5f92ced1
    • Niels De Graef's avatar
      Use "Returns:" to annotate return values · 1dda6015
      Niels De Graef authored
      To be able to annotate return values through GObject-introspection, you
      need to make sure it is tagged with `Returns:` and not something else.
      1dda6015
    • Niels De Graef's avatar
      Make sure to use % for constants · 746a72b9
      Niels De Graef authored
      Documentation-wise in C, this doesn't matter a lot, but it allows
      GObject-Introspection based bindings to use their built-in versions when
      they want to render any kind of documentation (for example, docs for
      Python plugins can render `%NULL` as `None`).
      746a72b9
  11. 31 Jul, 2019 1 commit
  12. 25 Jul, 2019 3 commits
  13. 21 Jul, 2019 1 commit
    • Michael Natterer's avatar
      app: fix render cache artifacts when resizing the canvas · d88b90d0
      Michael Natterer authored
      Since introducing gimp_display_shell_canvas_tick() we were setting
      shell->disp_width and shell->disp_height in the tick callback, which
      was too late and caused redundant rendering and scrolling, but was
      never noticed.
      
      Now we clear the render cache and its valid region in
      gimp_display_shell_canvas_size_allocate() directly and set
      shell->disp_width and shell->disp_height immediately, so other places
      that listen to the canvas' size-allocate get the right values.
      
      The old size of the canvas gets to the tick callback using a small
      struct as user data.
      d88b90d0
  14. 17 Jul, 2019 3 commits
    • Jehan's avatar
      Issue #3070: CRITICAL when converting to Indexed image. · 03f645cd
      Jehan authored
      Revert the previous commit 786686a5 and comes up with a better fix.
      
      Let's actually change the image base type and add its colormap as close
      as possible without any GUI calls in-between. I also add an explicative
      comment so that people are aware of this call proximity requirement to
      avoid future problems when the code gets remixed.
      
      It should be better than hacking around with exception in GUI code, and
      should (hopefully) avoid other similar bugs.
      03f645cd
    • Jehan's avatar
      Issue #3070: CRITICAL when converting to Indexed image. · 786686a5
      Jehan authored
      Fixes the GIMP-CRITICAL:
      
      > gimp_babl_format_get_trc: assertion 'format != NULL' failed".
      
      During an indexed conversion, we are in a weird limbo state between the
      time we changed the base-type to GIMP_INDEXED and when we actually set
      the new palette. If during this time, we hit a context switch (which
      typically happens during GUI code; in this specific cases, the various
      progress updates would call gimp_widget_flush_expose() which does
      trigger context switch), then gimp_display_shell_update_title_idle()
      might be idly called. And when it does, it sees an indexed function with
      neither format nor builtin profile.
      786686a5
    • Michael Natterer's avatar
      app: fix crash in the newly added GimpDisplayShell render_cache code · d93e9287
      Michael Natterer authored
      Must initialize shell->render_buf_width,height before realize(), so
      move the code to gimp_display_shell_init(), it doesn't depend on the
      shell being realized.
      d93e9287
  15. 16 Jul, 2019 4 commits
    • Michael Natterer's avatar
      app: use CAIRO_OPERATOR_SOURCE in gimp_display_shell_scroll() · c393eff0
      Michael Natterer authored
      to copy around the render cache when scrolling.
      c393eff0
    • Michael Natterer's avatar
      app: fix gimp_display_shell_render() to draw alpha correctly · 2061cc00
      Michael Natterer authored
      Drawing the image needs to replace the render cache's alpha, so draw
      with CAIRO_OPERATOR_SOURCE.
      2061cc00
    • Øyvind "pippin" Kolås's avatar
      app: make use of display_config->zoom_quality · 85cf3630
      Øyvind "pippin" Kolås authored
      When set to FAST we do nearest neighbor from the next bigger mipmap
      level instead of linear or box filtering - this gives a slight and
      permanent boost to painting, and all updates, having one that combines
      best of both worlds and reblits in high quality after a timeout would
      be even more desirable.
      85cf3630
    • Michael Natterer's avatar
      app: make display update much faster again · 9aa6aa1f
      Michael Natterer authored
      Introduce a render cache that keeps the result of scaling, color
      management, display filters and shell mask (for tools like fuzzy
      select).
      
      Change gimpdisplayshell-render.[ch] to only render to the cache and
      manage a cairo region of the cache's valid area. Call cache
      invalidation functions form various places. Change the API of all
      render functions to be in display coordinates.
      
      Also get rid of gimpdisplayxfer.[ch] because we now have a
      canvas-sized cairo surface which is a surface similar to the
      destination surface.
      9aa6aa1f
  16. 02 Jul, 2019 1 commit
    • Michael Natterer's avatar
      app: start porting away from GtkAction and friends · 86e07c16
      Michael Natterer authored
      Step one: get rid of all those deprecation warnings that make
      it hard to see any other warnings:
      
      - add a lot of dummy API to GimpAction, GimpActionGroup, GimpUIManager
        etc. which simply forwards to the deprecated GTK functions, they
        will all go away again later
      - rename GimpAction to GimpActionImpl
      - add interface GimpAction that is implemented by all action classes,
        creates a common interface and allows to remove some duplicated
        logic from GimpToggleAction and GimpRadioAction, and at the same
        time adds more features
      86e07c16
  17. 01 Jun, 2019 1 commit