Commit Graph

42820 Commits

Author SHA1 Message Date
b2cb334b47 app, libgimp: forgot to add /*< pdb-skip >*/ to enum GimpBucketFillMode
so it was still exported to libgimp.
2019-01-02 16:18:28 +01:00
07e46abb72 app, libgimp*: move enum GimpBucketFillMode to the core
The libgimp API using it is gone.
2019-01-02 16:07:20 +01:00
368f2e596a app, libgimpbase: move enum GimpBucketFillArea to the core
The whole bucket fill specific enum stuff is on its way out, so let's
keep this one out of libgimp for now until we decide how to present
line art filling in the PDB.
2019-01-02 15:47:31 +01:00
Ell
78ed038fca app: in GimpTileHandlerValidate, avoid fetching/copying whole tiles
In GimpTileHandlerValidate, when rendering a whole tile in respone
to a TILE_GET command, use gegl_tile_handler_get_tile() to get the
tile without preserving its data, so that we avoid unnecessarily
fetching the tile from storage, or copying its data during
uncloning.
2019-01-02 07:41:34 -05:00
aa02d619f7 plug-ins: in file-png, pass a more correct SAVE_COLOR_PROFILE flag...
...to gimp_image_metadata_save_finish(). Set it based on whether the
profile was actually saved, not if we only intended to save it.
2019-01-02 13:18:32 +01:00
abd7cbfc8d Issue #1788 - Inconsistency between FG color and selected color in...
...palette views despite selected color being in the currently
selected pallette

As suggested by Massimo, changing the color comparison EPSILON in
gimppalette.c from 1e-10 to 1e-6 fixes this, and is really small
enough.

Also, generally clean up color comparison epsilons:

- use a #define, not hardcoded values for all uses of
  gimp_rgb[a]_distance()
- call the #defines RGB_EPSILON and RGBA_EPSILON
- make them all 1e-6 or larger
2019-01-02 01:49:43 +01:00
8a4aacb52f Issue #2667 - When copying a text layer, paste should create a new...
...text layer, not an image of the text

In gimp_edit_paste_get_layer(), when pasting as floating selection,
collapse the pasted layer into an ordinary layer only if it's a group
layer. There is nothing that speaks against having a floating text
layer, it works just fine.
2019-01-02 00:14:35 +01:00
d873290915 libgimp: use G_N_ELEMENTS() in gimp_image_metadata_save_finish()
intead of hardcoding the array length.
2019-01-01 20:26:07 +01:00
b24cc6e7fa configure.ac: require babl >= 0.1.61 2019-01-01 19:21:52 +01:00
a338220fa6 app: fix the layer formats of indexed images to contain the space
Add gimp_image_colormap_update_formats() which does:

- always update the cached palette formats based on the current space
  of the image
- always set the palette entries on the palette formats

Make sure the function is called whenever the space or the colormap
change.

Fix gimp_image_convert_profile_colormap() to convert the colormap
entries between the right spaces.
2019-01-01 19:06:23 +01:00
dfe3e23622 libgimp: fix gimp_drawable_get_format() to honor the drawable's space
The raw PDB wrapper _gimp_drawable_get_format() only transfers the
format's encoding, so we need to add the space from the image's color
profile.

Also fix handling of indexed formats: remove our own indexed format
cache and rely on babl_new_palette_with_space() to return the same
format for any (encoding, space) combination.

Also update the PDB docs to reflect that most magic is happening in
the libgimp C wrapper.
2019-01-01 18:28:10 +01:00
78f5d39e1a app, libgimpcolor: handle palette formats across babl_format_with_space()
Don't just pass the input format's encoding because that loses the
palette. Instead, pass the input format directly so
babl_format_with_space() can do its job of preserving the palette.
2019-01-01 16:34:57 +01:00
Ell
070e10eda7 app: show message when attempting to change layers while there is a floating sel.
In GimpDrawableTreeView, show an error message when attempting to
select a different drawable while the image has an active floating
selection.  In GimpLayerTreeView, also blink the editor button-row
when this happens, as a hint that the floating selection can be
committed/canceled through the buttons (we already highlight the
relevant ones.)
2019-01-01 09:14:24 -05:00
Ell
192bc9536c plug-ins: in image-map, fix spin-scale adjustment
Fix deprecated use of non-zero page size for a spin-button
GtkAdjustment, and increase the page increment.
2019-01-01 07:52:36 -05:00
Ell
3351174ebe app: more optimizations to gimp_gegl_mask_bounds()
Another inner-loop logic improvement.
2019-01-01 06:53:18 -05:00
Ell
819a5352f6 app: optimize gimp_gegl_mask_bounds()
... by using the mask's native format, and improving the inner-loop
logic.
2019-01-01 06:34:09 -05:00
Ell
986a298a07 app: optimize gimp_gegl_mask_is_empty()
... by using the mask's native format, and gegl_memeq_zero().
2019-01-01 06:34:08 -05:00
8fd072dc29 Update Swedish translation
(cherry picked from commit dd2a4cd97f)
2018-12-31 23:40:41 +00:00
ad5bf1dee7 cursors: add -HiDPI variants of all cursors
This includes gimp-tool-cursors-x2.xcf and cursorname-x2.png files,
they are simply 72x72 upscaled versions of the 36x36 fies with no
changes.

Anyone can now improve on cursors without having to deal with the
bulid process.
2018-12-31 22:22:25 +01:00
26ae35fc3d app: make GimpErrorConsole's icons HiDPI-aware
by simply inserting a GtkImage (which does everything right all by
itself) insted of a GdkPixbuf.
2018-12-31 19:41:47 +01:00
e3e2cdcbd2 app: make GimpFgBgEditor and GimpStatusbar HiDPI-aware
so their icons look proper again on HiDPI monitors.
2018-12-31 19:12:00 +01:00
20225a2268 app: fix last gimpcursor.c commit: g_printerr() needs a newline 2018-12-31 19:11:22 +01:00
eef735a49c app: make a HiDPI-aware magenta fallback square in gimp_widget_load_icon() 2018-12-31 18:44:35 +01:00
8ff8f1d442 app: support cursors with a scale factor of 2 for HiDPI
If the scale factor is 2 or larger, look for cursor images named
"filename-x2.png" and use them via
gdk_cairo_surface_create_from_pixbuf() and
gdk_cursor_new_from_surface().

Manually scale up the default cursor if there is no "x2" image, using
NEAREST interpolation, which looks better than the default smooth
scaling done by gdk_cursor_new_from_pixbuf() on HiDPI monitors.

Next: adding better HiDPI cursor images.
2018-12-31 16:10:46 +01:00
47ff7e1467 app: pass a GdkWindow not GdkDisplay to gimp_cursor_new()
Preparation for adding HiDPI cursors.
2018-12-31 14:04:04 +01:00
Ell
3738ff3ffd app: small fix to gimp_drawable_edit_fill() 2018-12-31 05:33:42 -05:00
Ell
e967e5fa9e app: show error on attempt to clear/cut layer with locked alpha channel
Show an error message, and blink the layers-dialog lock-box, when
attempting to clear/cut a layer with a locked alpha channel.
2018-12-31 04:40:10 -05:00
Ell
6384ff01b6 app: in gimp_drawable_edit_fill(), make trivial alpha-only fill a NOP
In gimp_drawable_edit_fill(), if the fill only affects the alpha
channel, and if the drawable has no alpha channel, or the alpha
channel is masked out, do nothing, instead of unnecessarily
performing the fill, which has no effect.
2018-12-31 04:40:09 -05:00
637270615b Update Swedish translation
(cherry picked from commit 5198681493)
2018-12-30 21:07:27 +00:00
2847b1143b Update Swedish translation
(cherry picked from commit 90a8819072)
2018-12-30 20:46:00 +00:00
Ell
d9b4ffe09e app: in gimp_gegl_apply_cached_operation(), intersect cached rects with dest rect
In gimp_gegl_apply_cached_operation(), intersect the cached rects
with the dest rect, so that we don't unnecessarily (if not
erroneously) copy cached regions outside the dest rect to the dest
buffer.  This can happen when the op's applicator crop-rect changes
dynamically.
2018-12-30 08:05:55 -05:00
Ell
e06c4643dc app: in warp tool, crop filter to stroke bounds
In the warp tool, set the drawable-filter's crop area to the
combined stroke bounds, so that, when comitting the tool, only this
area is processed, instead of the entire drawable area.
2018-12-30 05:13:02 -05:00
Ell
b846ffed19 app: in GimpDrawableFilter, only update crop/preview area when updating whole drawable
In GimpDrawableFilter, when updating the entire filter area, only
update the crop/preview area (as set by
gimp_drawable_filter_set_{crop,preview}()), instead of the entire
drawable.
2018-12-30 05:13:01 -05:00
Ell
5c27d14fdf app: add gimp_drawable_filter_set_crop()
Add gimp_drawable_filter_set_crop(), which allows setting an output
crop rectangle for the filter; anything outside the rectangle
doesn't get filtered.  The crop area is combined with the preview
area to determine the filtered area during preview, however, unlike
the preview area, the crop area remains in effect while committing
the filter.

Consequently, when merging a drawable filter, if the filter has a
crop, only process the cropped area.
2018-12-30 05:13:01 -05:00
Ell
7534ae53d6 app: rename gimp_applicator_set_preview() to _set_crop(); add _get_crop()
We're going to use GimpApplicator's output crop for more than just
split previews.  Rename gimp_applicator_set_preview() to
gimp_applicator_set_crop(), and add gimp_applicator_get_crop(),
which returns the output crop rectangle, or NULL if cropping is
disabled.
2018-12-30 05:13:00 -05:00
Ell
093e017df8 app: in GimpFilterTool, make region combo insensitive when selection is empty 2018-12-29 20:55:40 -05:00
Ell
7949fd9a28 app: in GimpFilterTool, show region combo for non-point ops
In GimpFilterTool, show the region combo when applying a non-point
op, as well as when applying a position-dependent point op.  The
result of non-point ops may depend on the choice of input region,
even if the op is not position-dependent.
2018-12-29 20:27:42 -05:00
Ell
b201f73562 app: use GimpDrawableFilter in gimp_drawable_apply_operation()
In gimp_drawable_apply_operation(), use a temporary
GimpDrawableFilter to apply the operation, instead of using a
shadow buffer.  This renders and composits the op directly into the
drawable buffer, avoiding an intermediate buffer, requiring less
space and speeding up processing.
2018-12-29 14:28:43 -05:00
Ell
ab52dc6bca app: in GimpApplicator, allow enabling cache/preview after construction; remove preview cache
Remove the use_split_preview and use_result_cache parameters of
gimp_applicator_new(), and allow enabling/disabling the cache
(through gimp_applicator_set_cache()) and the preview crop (through
gimp_applicator_set_preview()) after construction.

Move the preview crop node after the result cache, and remove the
separate preview cache node.  This eliminates an extra cache
buffer, reducing the space consumed by filters, and speeds up split
preview, since the cached result now includes the output
compositing.
2018-12-29 14:28:42 -05:00
42dd3fd939 Added OARS 2018-12-29 10:25:58 +00:00
Ell
cba4bc4781 app: in gimp_drawable_merge_filter(), align undo rect to tile grid
In gimp_drawable_merge_filter(), align the region copied to the
undo buffer to the drawable buffer's tile grid, so that the copied
tiles are COWed.
2018-12-28 08:30:59 -05:00
Ell
95393722cc Revert "Bug 796090 - (wrong) true-color preview of GEGL filter ops, ..."
We now perform the conversion of filter output to the drawable
format as part of the individual filter nodes (see the last few
commits), so there's no need for another conversion after the
filter stack.

This reverts commit d6e0ca5054.
2018-12-28 03:56:31 -05:00
Ell
3f45e893bf app: cache result of floating selections
Use an output cache for floating-selection filters, to speed up
anchoring.
2018-12-28 03:55:35 -05:00
Ell
0560c5a6fe app: use drawable format as floating-sel applicator output format
Set the output format of floating-selection applicators to the
target drawable format.  We're going to remove the global
GipDrawable convert-format node, which we use to get correct
previews for indexed drawables, so that each filter now has to do
its own format conversion.
2018-12-28 03:55:34 -05:00
Ell
8e57ee2265 app: in GimpDrawableFilter, use the drawable format as the cache format
In GimpDrawableFilter, set the applicator's output format to the
drawable format, so that the cache uses the drawable format, and so
copying the cached result to the drawble's buffer when comitting
the filter becomes much cheaper, and, in particular, doesn't
require reading tiles out of the swap.  This notably improves
commit speed in large images, at the expense of requiring a few
extra conversions during preview.
2018-12-28 03:55:34 -05:00
Ell
b93df0311f app: add gimp_applicator_set_output_format()
In GimpApplicator, add gimp_applicator_set_output_format(), which
can be used to explicitly set the format of the result.  In
particular, this allows controlling the output cache format, which
can speed up the merging of cached filters.
2018-12-28 03:55:33 -05:00
Ell
85e454bae8 app: add GimpDrawable::format-changed signal
... which is emitted when the drawable's format is changed.
2018-12-28 03:55:33 -05:00
Ell
ef9b1f6694 app: in GimpLineArt, use "invalidate-preview" signal of input viewable
In GimpLineArt, use the "invalidate-preview" signal of the input
viewable, instead of its "painted" or "rendered" signals, for
asynchronously computing the line art.  Subsequently, remove the
aforementioned signals from GimpDrawable and GimpProjection,
respectively.  This simplifies the code, and reduces the number of
signals.
2018-12-27 17:14:28 -05:00
Ell
12e83350bf app: remove gimp_applicator_dup_apply_buffer()
... nothing uses it after last commit.
2018-12-27 14:00:24 -05:00
Ell
ed7ea51fb7 app: remove "Edit -> Fade..."
This commit completely removes the "Edit -> Fade..." feature,
because...

- The main reason is that "fade" requires us to keep two buffers,
  instead of one, for each fadeable undo step, doubling (or worse,
  since the extra buffer might have higher precision than the
  drawable) the space consumed by these steps.  This has notable
  impact when editing large images.  This overhead is incurred even
  when not actually using "fade", and since it seems to be very
  rarely used, this is too wasteful.

- "Fade" is broken in 2.10: when comitting a filter, we copy the
  cached parts of the result into the apply buffer.  However, the
  result cache sits after the mode node, while the apply buffer
  should contain the result of the filter *before* the mode node,
  which can lead to wrong results in the general case.

- The same behavior can be trivially achieved "manually", by
  duplicating the layer, editing the duplicate, and changing its
  opacity/mode.

- If we really want this feature, now that most filters are GEGL
  ops, it makes more sense to just add opacity/mode options to the
  filter tool, instead of having this be a separate step.
2018-12-27 11:44:25 -05:00