Commit Graph

267 Commits

Author SHA1 Message Date
Ell 889e2e26ee app: remove gimp-scratch; replace with gegl-scratch
The scratch allocator has been moved to GEGL (commit
gegl@b99032d799dda3436ffa8c1cc28f8b0d34fb965d).  Remove gimp-
scratch, and replace all its uses with gegl-scratch.
2019-01-06 07:37:19 -05:00
Ell 471fa632cd app: fix gimp-scratch linking in tests/ 2018-12-01 07:24:50 -05:00
Jehan ec78a7e419 app: gdk_test_simulate_key() Win32 replacement code unneeded on master.
This is still needed on the gimp-2-10 branch since the implementation
appeared on GTK+ 2.24.25. But for GTK+3, it appeared for 3.14.0, which
is below our current minimum requirement on master. So let' clean out
this now useless piece of code.
2018-11-24 11:34:51 +01:00
Oleksii Samorukov 7921b24a89 tests: implement gimp_test_utils_synthesize_key_event on OSX/QUARTZ
(cherry picked from commit 9ae19eb8ec)
2018-11-23 23:07:20 +01:00
Alex Samorukov 53f0f93556 add to fix test link on OSX
(cherry picked from commit d650e9f81f)
2018-11-23 10:56:52 +01:00
Ell 4113aaad69 app: fix tests for new show-tabs option
In app/tests, add the show-tabs pref, added in commit
1ca2d74411, to the expected sessionrc
files.
2018-10-27 05:43:13 -04:00
Ell 7cdd1ebeef app: add source location information to the Linux GimpBacktrace backend
When libbacktrace is available, use it to retrieve source location
information in the Linux GimpBacktrace backend.
2018-09-22 22:39:08 -04:00
Ell 7a02859d32 app: fix app/tests linking
Required since commit 80bf686c94.
2018-09-02 04:57:40 -04:00
Michael Natterer e09e563a70 Initial space invasion commit in GIMP
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.
2018-07-21 16:42:57 +02:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer 6a7a010769 app: link tests against APPSTREAM_GLIB_LIBS 2018-07-06 13:26:07 +02:00
Michael Natterer d30ee3a773 app: adjust sessionrc-expected-multi-window, no further comment... 2018-07-01 19:59:51 +02:00
Michael Natterer 8516aedade app: on make check, search menu XML files in both buildir and srcdir
Turn GIMP_TESTING_MENUS_DIR into GIMP_TESTING_MENUS_PATH and look in
all its dirs for the menu file.
2018-07-01 19:33:51 +02:00
Michael Schumacher 599f4bfd8b app: fix .NOTPARALLEL: check target 2018-06-29 09:15:44 +00:00
Michael Schumacher c008ef7e85 app: Prevent parallel builds for the tests
The tests must not be run in parallel or in a different order as specified.
2018-06-29 07:49:06 +00:00
Jehan c21eff4b03 Issue #1689: create unique temporary file with g_file_open_tmp().
Not sure this is really solving the issue reported, which is that
`g_get_tmp_dir()` uses environment variables (yet as g_file_open_tmp()
uses g_get_tmp_dir()…). But at least g_file_open_tmp() should create
unique temporary files, which prevents overriding existing files (which
is most likely the only real attack possible here, or at least the only
one I can think of unless some weird vulnerabilities exist in glib).
2018-06-24 04:55:44 +02:00
Michael Natterer e237d431de app: fix some stuff in tests, down to 3 failing
- set GIMP3_DIRECTORY env variable not GIMP2_DIRECTORY
- make sure the cursors resource gets compiled in
- remove tab autosizing test, that code is gone
2018-05-29 00:44:51 +02:00
Michael Natterer 2ae830290e app: fix synthesizing pointer events in test-tools.c
Makes tests fail later.
2018-05-28 08:59:37 +02:00
Michael Natterer baaa2cd7ca app: remove the entire dockable tab auto-sizing code
It was totally broken and could never work like this in GTK+ 3.x, and
if it can be reimplemented it should be started from scratch.
2018-05-26 16:28:58 +02:00
Michael Natterer a33fcfd43c app: fix gimp_test_utils_create_image_from_dialog()
to reliably press the OK button. Makes tests fail a bit later.
2018-05-26 12:40:53 +02:00
Ell 3673352c99 app: update tests for new GDK/GIMP API
This only makes the tests build, though they still fail.
2018-05-26 04:11:50 -04:00
Jehan 7642715c17 app: allow setting parent for dialogs created by GimpDialogFactory.
Fixes a bunch of:
> Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
2018-05-20 21:06:33 +02:00
Michael Natterer 5ece7a8d1f Port a lot of stuff from GdkScreen/monitor_number to GdkMonitor
including some fixes for getting pointer coords, and needed
API changes in libgimpwidgets.
2018-05-20 21:06:30 +02:00
Michael Natterer 4591452007 app: remove the gimp-2-6 session compatibility test
It was unreliable and a huge pain, and 2.6 is really old shit.
2018-05-20 20:02:13 +02:00
Michael Natterer 1d3bd593c1 app: nobody knows why this is needed, move along 2018-05-20 02:36:31 +02:00
luz.paz 4a77ff2d3d Bug 795557 - Misc. typo fixes in source, comments and doxygen (pt3)
Found via `codespell` and grep.
2018-04-25 23:49:06 +02:00
luz.paz 7fdb963e01 Bug 794996 - Misc. typo fixes in comments in app/
Found via `codespell -q 3 --skip="./po*"`
2018-04-08 21:25:56 +02:00
Jehan 888baac9c8 Revert "app: tweak sessionrc-expected-2-6 for make check to succeed."
This reverts commit 554347e0ff.
For some weird reason, this fixed the `make check` but broke the `make
distcheck`. I am lost. Better revert, and now distcheck works great.
2018-03-24 05:25:52 +01:00
Jehan 554347e0ff app: tweak sessionrc-expected-2-6 for make check to succeed.
I'm not sure how useful is this test if we have to just constantly tweak
the sessionrc for it to pass. But well… here it is.
Now make check fully passes.
2018-03-24 03:47:21 +01:00
Michael Natterer 48f31f21ae app: another try to tweak the test sessionrc-expected-2-6 2018-02-22 13:33:29 +01:00
Michael Natterer 6d056ff91a app make tests pass again (update sessionrc-expected-2-6) 2018-02-22 00:15:56 +01:00
Ell 7da24fd97b app: bump GIMP_UI_WINDOW_POSITION_EPSILON in test-ui.c
The current value (25) is a bit too low over here (getting 28),
bump it to 30.
2017-11-13 17:19:05 -05:00
Ell fdd8b3f4f6 app: add "#include <gegl.h>" to tests
Needed since commit c5b88702e6.
2017-10-28 10:54:19 -04:00
Ell e06a18b944 app: use a single size entry for the pos/size props of GimpRectangleOptions
Repalce the two separate size entries, used for the position and
size properties of GimpRectangleOptions, with a single size entry
with two fields, so that they accept ratio expressions.  Note that
this doesn't change the UI.
2017-10-04 14:25:02 -04:00
Michael Natterer 1cbb2f3309 app: add a comment to test-xcf.c about why we use LEGACY layer modes 2017-08-20 15:02:46 +02:00
Michael Natterer 730573375d app: use GIMP_LAYER_MODE_NORMAL for most tests in app/tests/ 2017-08-20 14:09:35 +02:00
Ell 71bbd88e00 app: layer mode code shuffling
Commit 3635cf04ab moved the special
handling of bottom-layer compositing to GimpOperationLayerMode.
This required giving the op more control over the process()
function of its subclasses.  As a temporary workaround, the commit
bypassed the subclasses entirely, using "gimp:layer-mode" for all
modes.  This is the reckoning :)

Add a process() virtual function to GimpOperationLayerMode, which
its subclasses should override instead of
GeglOperationPointComposer3's process() functions.  Reinstate the
subclasses (by returning the correct op in
gimp_layer_mode_get_oepration()), and have them override this
function.

Improve the way gimp_operation_layer_mode_process() dispatches to
the actual process function, to slightly lower its overhead and
fix some thread-safety issues.

Remove the "function" field of the layer-mode info array, and have
gimp_layer_mode_get_function() return the
GimpOperationLayerMode::process() function of the corresponding
op's class (caching the result, to keep it cheap.)  This reduces
redundancy, allows us to make the ops' process() functions private,
and simplifies SSE dispatching (only used by NORMAL mode,
currently.)

Move the blend and composite functions of the non-specialized
layer modes to gimpoperationlayermode-{blend,composite}.[hc],
respectively, to improve code organization.

Move the SSE2 composite functions to a separate file, so that they
can be built as part of libapplayermodes_sse2, allowing
libapplayermodes to be built without SSE2 compiler flags.  This
allows building GIMP with SSE acceleration enabled, while running
the resulting binary on a target with no SSE accelration.

Add a "blend_function" field to the layer-mode info array, and use
it to specify the blend function for the non-specialized modes.
This replaces the separate switch() statement that we used
previously.

Remove the "affected_region" field of the layer-mode info array.
We don't need it anymore, since we can go back to using
GimpOperationLayerMode's virtual get_affected_region() function.

Last but not least, a bunch of code cleanups and consistency
adjustments.
2017-08-17 11:19:37 -04:00
Michael Natterer e8ee5475b7 app: move all propgui files from app/widgets/ to new folder app/propgui/
We are getting more and app/widgets/ is already too large.
2017-07-03 12:29:41 +02: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
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 8d744bc6c6 app, libgimp: found two more hidden GIMP_LAYER_MODE_NORMAL_NON_LINEAR 2017-01-28 22:48:36 +01:00
Michael Natterer dd3eec6198 app: change linking order of the sub-libs of app/operations
so layer-modes/ can use the enums in enums-types.h without failing to
link.
2017-01-17 14:28:40 +01:00
Michael Natterer 87e5d10ddb app: make tests build again 2017-01-15 18:52:43 +01:00
Michael Natterer 2ed8bd1fce app: use relative paths in tests/Makefile.am
Shorter and more readable.
2017-01-10 10:43:24 +01:00
Michael Natterer 60dcb17874 app: fix layer mode in test-xcf.c 2017-01-09 22:18:05 +01:00
Michael Natterer fd070eeb25 app: start moving layer modes into their own build directories
New directories:

operations/layer-modes/
operations/layer-modes-legacy/
2017-01-09 21:58:18 +01:00
Michael Natterer 152adbb1bd Rename GIMP_LAYER_MODE_FOO_BROKEN to GIMP_LAYER_MODE_FOO_LEGACY
"Broken" sounds like it needs fixing, but it's legacy compat stuff
that will have to stay for all eternity.
2017-01-09 01:27:20 +01:00
Michael Natterer 66060e3307 app, libgimp*, plug-ins: replace enum GimpLayerModeEffects by GimpLayerMode
with proper value names. Mark most values as _BROKEN because they use
weird alpha compositing that has to die. Move GimpLayerModeEffects to
libgimpbase, deprecate it, and set it as compat enum for GimpLayerMode.
Add the GimpLayerModeEffects values as compat constants to script-fu
and pygimp.
2017-01-08 23:00:19 +01:00
Nils Philippsen ce2e95139a use better prefix for previous patch 2016-07-31 20:53:11 +02:00
Nils Philippsen 454c60970f avoid clashing with remove(3) prototype 2016-07-31 20:50:29 +02:00