Commit Graph

651 Commits

Author SHA1 Message Date
Michael Natterer 0cfe550639 app, pdb: change a lot of GIMP_LAYER_MODE_NORMAL_LEGACY to just NORMAL
this commit changes just those which make no difference to
functionality: property and object member defaults that get overridden
anyway, return values of g_return_val_if_fail(), some other stuff.
2017-08-19 20:33:47 +02:00
Øyvind Kolås bac042db39 app/gegl: temp hotfix to disable threading in gegl:copy-buffer 2017-08-19 17:12:15 +02:00
Ell 64ade97702 app: move libappgegl's SSE2 bits to a separate library
Split libappgegl into libappgegl-generic and libappgegl-sse2, and
move the SSE2 code (part of the newly added smudge code) to the
latter, so that the rest of the code can be compiled without SSE2
compiler flags.  This allows building GIMP with SSE acceleration
enabled, while running the resulting binary on a target with no
SSE accelration.
2017-08-17 13:04:27 -04:00
Ell 7ecd3f2783 Bug 785890 - libappgegl doesn't use SSE2 compiler flags ...
... causing compilation to fail on 32 bit targets

Use SSE2 compiler flags when building libappgegl, since it's used by
the new smudge tool code.

Avoid using SSE for the smudge tool if SSE acceleration is disabled
at runtime, or if the buffers are not properly aligned.
2017-08-06 14:13:01 -04:00
Michael Natterer 572063765f app: use "const GeglRectangle*" in the GimpTileHandlerValidate API 2017-08-05 15:49:06 +02:00
Michael Natterer 12f920d8bf app: change GimpTileHandlerValidate's API to use GeglRectangle
instead of x, y, width, height.
2017-08-05 15:43:41 +02:00
Michael Natterer bcda53ee7b Bug 785001 - Enhanced smudge tool: Smudge with painting
Apply patches from shark0r that alow to mix in both constant and
gradient color while smudging; and clean up the patches.
2017-07-23 14:44:22 +02:00
Michael Natterer 0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
More than 2000 lines of code less in app/, instead of

if (instance->member)
  {
    g_object_unref/g_free/g_whatever (instance->member);
    instance->member = NULL;
  }

we now simply use

g_clear_object/pointer (&instance->member);
2017-07-15 18:42:44 +02:00
Michael Natterer 1f5739de57 app: set the number of threads on GeglConfig again, it needs testing
- enable the setting code in gimp-gegl.c again
- but set the default to one thread in GimpGeglConfig, with a CPP warning
- rename "processors" to "threads" in the GUI
- add a warning box about unexpected results when increasing #threads
2017-06-28 19:05:58 +02:00
Ell 3ca48a0b30 enums: don't use comments in generated enum recipes
Works in bash, but apparently not portable.
2017-06-02 11:15:43 -04:00
Ell 5bcde32caf enums: run gimp-mkenums from the build dir
Commit 1e6acbd4e1 modified the
generated enum recipes to run gimp-mkenums from the source
directory, instead of the build directory, so that only the
basenames of the corresponding header files would appear in
the comment at the top of the generated files.  This was a
mistake -- $(GIMP_MKENUMS) is expecting to be invoked from the
build directory.

Switch back to running gimp-mkenums from the build directory.  To
avoid including the relative path from the build directory to the
source directory in the generated file, add a @basename@ production
variable to gimp-mkenums, which exapnds to the basename of the
input file, and use it instead of @filename@ in the recipes for the
generated enum files.
2017-05-22 20:29:18 -04:00
Ell f9fa0d1b18 enums: don't write generated enum files to src-dir if unchanged
When regenerating an enum file, don't copy it back to the source
directory if it hasn't actually changed.  This allows using a read-
only source directory where the enum header is newer than the
generated file, as long as they're not really out of sync.

OTOH, *do* touch the generated source-dir file even when unchanged,
in order to avoid re-running its recipe on the next build, however,
allow this to silently fail (which is harmless).
2017-05-22 17:58:04 -04:00
Ell 1e6acbd4e1 enums: generate enum files in source dir
We check them into git, so this makes it easier to keep them in
sync when using a separate build directory.

Case in point -- this commit also syncs a few enum files that went
out-of-sync with their headers.
2017-05-06 17:26:16 -04:00
Ell e0dcf538e5 Bug 781804 - Dodge/Burn tool produces artifacts with negative channel values
The halftones transfer mode of dodge/burn uses pow(), which produces
NaN for negative input values.  This tool doesn't really have OOG
values in mind, but using an odd power function fixes this issue,
and is in line with the behavior of the other modes w.r.t. OOG
values.
2017-04-26 21:30:43 -04:00
Michael Natterer ee6c7ec7b7 Bug 780015 - Filter settings are not properly restored after Gimp restart
Filters settings used to be serialized and deserialized only
when a filter tool's GUI was shown, too late for the code that
re-runs/re-shows filters with previous values.

Move the entire loading/saving code to gimp-operation-config.c, even
adding/removing the dummy separator item between timestamped automatic
history and manually saved settings. Load the settings automatically
when a settings container is requested, but still trigger saving from
the few places the container is changed in the GUI; could also
automate that later.

This commit also moves all settings of filters that have their own
tools from gimpdir/tool-options/ to gimpdir/filters/. Add compat code
to try the old filename if the new doesn't exist, so files are
migrated automatically.

WIP, but this step already fixes the bug.
2017-03-24 01:29:50 +01:00
Michael Natterer 3cf423f0cd *: rename NORMAL to NORMAL_LEGACY and NORMAL_LINEAR to NORMAL
and make NORMAL_LEGACY immutable.
2017-02-26 16:26:34 +01:00
Ell 7402127505 app: remove GIMP_LAYER_MODE_FLAG_WANTS_LINEAR_DATA and friends
Instead, add a gimp_layer_mode_get_format() function, which takes
the layer mode, composite space, and blend space, and returns the
I/O format.

Currently, we always use the composite space format as the I/O
format.  This simplifies gimp_composite_blend(), and gives us
composite-space support for the "special" layer mode ops for free.
2017-02-17 18:19:32 -05:00
Michael Natterer 8634b5cbc3 app: make layer blend color space and compositing color space configurable
...they say it's going to get worse before it gets better...
2017-02-12 23:49:26 +01:00
Michael Natterer 891f85e805 app: move gimp-gegl-config.[ch] to operations/
and rename it to gimp-operation-config.[ch].
2017-02-05 20:17:31 +01:00
Michael Natterer 2950fecf07 app: move layer mode enums and gimp-layer-modes.[ch] to operations/
and to operations/layer-modes/, respectively.

Add gimp_layer_modes_init() which asserts on the correct order of the
GimpLayerModeInfo array, and switch to accessing the array directly in
gimp_layer_mode_info().
2017-02-05 15:59:29 +01:00
Michael Natterer 2a96d598c3 app: add internal and PDB API and UI to control a layer's composite mode
Largely based on a patch by Ell, with the enum type renamed and
various small changes. Adds another axis of configurability to the
existing layer mode madness, and is WIP too.
2017-02-02 00:38:25 +01:00
Michael Natterer 2dbf1b46b2 app: rename gimp_layer_mode_is_linear() to gimp_layer_mode_wants_linear_data() 2017-01-31 01:43:48 +01:00
Michael Natterer d3b8a0d007 app: s/trc/space/ in the property names too 2017-01-22 17:14:44 +01:00
Michael Natterer b10fc58802 app: add a "layer-mode" property to GimpOperationLayerMode 2017-01-22 14:41:21 +01:00
Øyvind Kolås 894d4c0c01 app: finish GimpLayerColorSpace rename 2017-01-19 19:33:17 +00:00
Michael Natterer 1262370544 app: remove "gboolean linear" parameters
from gimp_applicator_new() and gimp_gegl_mode_node_set_mode().
Compositing doesn't depend on the layer format any longer, only on the
layer mode. Painting with "use applicator" unchecked is still broken
in some cases and needs more fixing.
2017-01-18 00:15:55 +01:00
Michael Natterer 6e72d3eddf app: add blend-trc and composite-mode properties to GimpOperationPointLayerMode
and set them to unused default values.
2017-01-17 15:09:17 +01:00
Michael Natterer a24e232522 app: move functions on enum GimpLayerMode to new files gimp-layer-modes.[ch] 2017-01-15 15:25:03 +01:00
Michael Natterer 50669fe6d4 app, libgimp: rename BEHIND enum values to be consistent with others
Also update gimplayermodefunctions.c which I forgot before.
2017-01-15 00:01:09 +01:00
Michael Natterer 6bf9e47ba8 app, libgimp: add linear variants of most layer modes
and reorder gimp_gegl_mode_node_set_mode() and friends.
2017-01-14 22:56:54 +01:00
Michael Natterer bd66794e2c app: avoid the second gegl_node_set() in gimp_gegl_mode_node_set_mode() 2017-01-14 18:35:56 +01:00
Øyvind Kolås 4df1af2534 app: add linear variant of behind mode 2017-01-12 14:27:15 +01:00
Øyvind Kolås 377f4687b1 app: add gimp_gegl_mode_is_linear 2017-01-11 22:13:14 +01:00
Øyvind Kolås 5271027510 app: explictly code linear vs gamma for hardlight and softlight 2017-01-11 19:39:46 +01:00
Øyvind Kolås f9aeff5670 app: fix a lingering old gimp:softlight-mode 2017-01-11 15:17:30 +01:00
Michael Natterer 8b5553cef6 app: move the remaining 3 layer modes to layer-modes/
Not exactly sure if all are correct, but the file moving is almost
done now.
2017-01-11 12:55:13 +01:00
Øyvind Kolås 7ed2857695 app: fix type s/legacyy/legacy/ 2017-01-11 05:34:55 +01:00
Øyvind Kolås ec1f7a94e3 app: split legacy out of grain extract and merge 2017-01-11 04:40:26 +01:00
Øyvind Kolås 8f3842434c app: split legacy out of soft and hard light 2017-01-11 04:10:06 +01:00
Øyvind Kolås 784a8ee224 app: split legacy out of burn and divide 2017-01-11 03:17:53 +01:00
Michael Natterer 0891028232 app: forgot to s/gimp:normal-mode/gimp:normal/g 2017-01-11 00:28:57 +01:00
Michael Natterer 9142bb1805 app: move erase and anti-erase to layer-modes/ 2017-01-11 00:23:31 +01:00
Øyvind Kolås 0fcc2cd772 app: also fix multiply enum/name mapping 2017-01-11 00:12:45 +01:00
Øyvind Kolås 2ce25045fe app: fix fix 2017-01-11 00:10:09 +01:00
Øyvind Kolås 33f6398e00 app: fix enum to name mapping for hsv legacy modes 2017-01-10 23:46:01 +01:00
Øyvind Kolås 71030f49e9 app: duplicate hsv layer modes, and fix alpha handling 2017-01-10 21:48:03 +01:00
Øyvind Kolås c3e5e30450 app: split legacy lighten only and darken only ops 2017-01-10 11:18:52 +01:00
Michael Natterer 99189d7a28 app: move dissolve to layer-modes/ 2017-01-10 09:06:16 +01:00
Øyvind Kolås 5a7fd54d34 app: split addition and subract in legacy and new 2017-01-10 01:40:14 +01:00
Michael Natterer 60e1d8e35f app: move the LCH layer modes to layer-modes/ 2017-01-10 01:04:49 +01:00