Commit Graph

40373 Commits

Author SHA1 Message Date
Ell f5cb1fed85 Bug 795081 - Crash when using a brush combined with a dynamics
In GimpPaintTool, brush outline generation took place during
gimp_paint_tool_draw() even while painting.  This function is run
concurrently with the paint thread.  When using dynamics, this
introduced a race conidition between updating the brush mask in the
paint thread, and updating the brush boundary in the main thread.

Move brush outline generation during painting to
gimppainttool-paint.c, and perform it in the display-update
timeout, while the main thread and the paint thread are
synchronized.
2018-04-09 14:27:48 -04:00
Ell e98506b000 app: remove option for paint tools to opt out of a separate thread
After last commit, all paint tools work correctly with a separate
paint thread, so we can remove the option for specific paint tools
to opt out.  Particularly, GimpMybrushTool now uses a separate
paint thread too.

Note that the separate paint thread can still be disabled through
the GIMP_NO_PAINT_THREAD environment variable.
2018-04-09 14:27:48 -04:00
Ell 2ae16ca604 app: reorganize gimppaintool-paint
Reorganize/clean up gimppainttool-paint.  In particular, move all
paint-core interaction during painting to gimppainttool-paint.c, so
that we can have more control over what's going on; specifically,
enter the drawable into paint mode *before* starting the paint
core, so that it picks up the correct buffer.  This fixes painting
with the paint thread using GimpApplicator, and enables us to use
the paint thread with GimpMybrushTool.
2018-04-09 14:27:48 -04:00
Jehan f77edcdf19 app: do not use gimp_filename_to_utf8() in the signal handler.
This function is unsafe during signal handling. And in any case, when
printing to stderr, I don't think we need to convert to UTF-8. Quite the
contrary, the system encoding may be more appropriate.
2018-04-09 06:14:41 +02:00
Jehan ab7c3d2b24 libgimpbase: oups, I lost the "full" option in my backtrace.
Quite useful to get values of local variables when possible.
2018-04-09 04:40:48 +02:00
Jehan 9dfd35be05 build: update base dependencies to fix flatpak. 2018-04-09 04:03:18 +02:00
Jehan bb52431cdd libgimpbase: gimp_stack_trace_*() should get backtraces for all threads.
Now that GIMP core is multi-threaded, let's get traces for all threads,
otherwise we may get some useless traces in some cases.
2018-04-09 02:18:20 +02:00
Michael Natterer 53fae39aee Bug 795057 - Insensitive text in plug-ins is unreadable with dark themes
Copy the fix from app/gui/themes.c to libgimp/gimpui.c so insensitive
labels look right in plug-ins too.
2018-04-08 22:55:19 +02:00
Piotr Drąg c4975dd893 Update Polish translation 2018-04-08 22:20:05 +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
Michael Natterer 8994246be2 Bug 791519 - Unexpected selection from channel
One additional fix for the gimp-channel-combine-masks procedure,
it needs both the combined *and* combined-to buffer in
gimp_gegl_mask_combine_buffer() to be treated specially.
2018-04-08 20:26:32 +02:00
Michael Natterer bb4ac7c829 Bug 791519 - Unexpected selection from channel
Storing selections and layer masks as linear grayscale, but channels
as whatever-the-layers-are caused severe problems in images with
gamma-corrected layers: when combining channels with the selection,
they would go thorugh a gamma conversion before being combined, giving
unexpected results.

This commit changes all channels to always be linear, except in 8-bit
images, where they continue to be "Y' u8", for compatibility with old
XCF files, and because linear 8-bit can't really be used in
compositing (channels can be visible too).

To fix channel -> selection combinations also for these images, add a
small hack to gimp_gegl_mask_combine_buffer() which makes sure the
to-be-combined channel's pixels are always read as-is, without any
gamma conversion. After changing channels to linear, this makes no
difference except in the 8-bit images where we need this hack.
2018-04-08 19:26:48 +02:00
Ell 8e7a34297f app: move painting to a separate thread
Add gimppainttool-paint.[ch], which takes care of painting during
motion events in GimpPaintTool.  Perform the actual painting in a
separate thread, so that display updates, which can have a
significant synchronization overhead, don't stall painting.

Allow specific paint tools to opt-out of a separate paint thread,
and avoid it in GimpMybrushTool, since it doesn't seem to work.

The separate paint thread can be explicitly disabled by setting the
GIMP_NO_PAINT_THREAD environment variable.
2018-04-08 09:42:48 -04:00
Ell ce9ca03ed4 app: add gimp_drawable_{start,end,flush}_paint()
gimp_drawable_start/end_paint() are used to enter/exit paint mode
for a given drawable.  While the drawable is in paint mode,
gimp_drawable_get_buffer() returns a copy of the real drawable's
buffer, referred to as the paint buffer, so that modifications to
the returned buffer don't immediately affect the projection, and
calls to gimp_drawable_update() queue the updated region, instead
of emitting an "update" signal.

gimp_drawable_flush_paint() can be called while the drawable is in
paint mode, in order to copy the updated region of the paint buffer
back to the drawable's real buffer, and to emit "update" signals
for the queued region.

We use these functions in the next commit, to move painting to a
separate thread in the paint tools.
2018-04-08 09:42:47 -04:00
Ell db50c72c24 app: align display paint area to a coarse grid
Align rectangles added to the display paint area, in
gimp_display_paint_area(), to a coarse grid, to reduce the
complexity of ther overall area.  This is similar to commit
49285463e6, however the alignment
happens in display space, instead of image space.
2018-04-08 09:42:47 -04:00
Thomas Manni 440be88035 Bug 794926 - Foreground select tool: several critical errors when ...
... double click during trimap painting

Disable double click when the tool is in trimap paint state.
2018-04-08 13:03:11 +02:00
Ell 6ebc3f1b09 Makefiles: don't use -xobjective-c when linking files on Mac
Last commit caused -xobjective-c to be passed during linking on
Mac, causing object files to be treated as source files.  Add a
-xnone flag to AM_LDFLAGS, canceling the effect of -xobjective-c.

Additinally, add a -xobjective-c++ flag to AM_CXXFLAGS, so that we
can use Objective-C in C++ files on Mac, if we ever need to.
2018-04-08 04:03:55 -04:00
Ell 06950be7f0 Makefiles: don't use -xobjective-c when compiling C++ files on Mac
On Mac, pass -xobjective-c to the compiler through AM_CFLAGS, not
AM_CPPFLAGS, so that it's only used for C sources, and not C++
sources.  In the latter case, it clashes with the -std=... flag,
spewing an error.  Thanks, Partha :)
2018-04-07 16:57:52 -04:00
Ell bea27171ad app: throttle statusbar progress updates
Statusbar progress updates that update the progress bar are
relatively expensive, slowing down operations that report progress
frequently.  Only update the progress bar if a certain amount of
time has passed since the last update, to counter that.
2018-04-07 12:05:59 -04:00
Ell 87a10aaf9e Bug 795048 - Image->mode->Grayscale results in a black or transparent image
In gimp_gegl_convert_color_profile(), when src/dest_rect is NULL,
use the extents of src/dest_buffer, instead of passing a NULL area
to gimp_parallel_distribute_area(), which results in a CRITICAL.

Additionally, only report progress on the main thread.
2018-04-07 12:05:59 -04:00
Massimo Valentini 81e1e3967d app: silence gcc warning
gimp-templates.c:143:15: warning: ‘strncpy’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Wstringop-truncation]
               strncpy (dpi, "ppi", 3);
               ^~~~~~~~~~~~~~~~~~~~~~~
2018-04-07 14:45:45 +02:00
Michael Natterer 2dd2f2f371 Bug 770424 - Themes: insensitive menu item are not readable
Need to check if we must override PixbufStyle's draw_layout() after
each theme change, not only at the beginning of themes_init(), so it
works also when the the pixbuf engine was not already loaded at
startup.
2018-04-07 12:33:18 +02:00
Jehan 0ae8e356d1 po: fix desktop file keywords syntax for Basque translation.
Some tool in flatpak-build was failing to validate the keywords because
of this localization. It was complaining that:

> key "Keywords[eu]" in group "Desktop Entry" does not have a semicolon
> (';') as trailing character
2018-04-07 01:22:23 +02:00
Jehan d907898c65 build: update dev and nightly flatpak manifests.
Dev flatpak now builds the 2.10.0 RC1.
Both manifest tested and working.
2018-04-07 01:17:09 +02:00
Jehan d2c4db1984 build: upstream flathub build and base modules updated too. 2018-04-06 21:09:50 +02:00
Jehan 494f68418a build: do not bundle glib anymore.
We now use the GNOME 3.28 runtime and glib 2.56.0 is bundled with it.
2018-04-06 21:01:15 +02:00
Michael Natterer 43549b7a38 app: remove some references to TileManager from xcf-load.c comments
and minor whitepace cleanup.
2018-04-06 12:56:31 +02:00
Ell f7c2ce9b13 app: fix smudge tool artifacts
Commit cb239e60f6 introduced
artifacts when using the smudge tool with multithreads.  Fix this
(caused by a wrong offset passed to an iterator) plus indentation
fixes.
2018-04-05 19:17:45 -04:00
Alexandre Prokoudine d66839993d Updated Russian translation 2018-04-06 02:09:48 +03:00
Jehan 87b9611628 app: fix build error "‘memset’ was not declared in this scope". 2018-04-05 23:57:34 +02:00
Alexandre Prokoudine 299a258237 NEWS: keep updated 2018-04-06 00:44:49 +03:00
Ell 4336e2e52a app: parallelize gimpbrushcore-loops.cc
Use gimp_parallel_distribute_foo() to parallelize the brush core
loops.
2018-04-05 17:41:29 -04:00
Ell 6e314b5090 app: move brush-core loops to a separate file
Move gimp_brush_core_{subsample,pressurize,solidify}_mask() to a
separate gimpbrushcore-loops.cc file, so that they can be C++-ified
independently from the rest of the code.  The next commit
parallelizes them.
2018-04-05 17:41:29 -04:00
Ell f7ea9abc73 app: add include guards to gimppatincore-loops.h 2018-04-05 17:41:29 -04:00
Ville Pätsi cf21dcbe37 Rework and rename the default Dark theme 2018-04-05 23:59:27 +03:00
Ville Pätsi 7aecc90e10 Remove Lighter, Darker, and Gray themes 2018-04-05 23:59:22 +03:00
Jehan 0009794d9d app: migrate tool-presets with s/GimpImageMapOptions/GimpFilterOptions/.
As requested!
2018-04-05 11:46:49 +02:00
Ell 082a6404c9 app: fix iterator area in canvas_buffer_to_paint_buf_alpha()
The entire ROI was processed in all threads, instead of only the
thread-specific area, causing artifacts.
2018-04-05 02:19:52 -04:00
Jehan b88170b9e0 NEWS: keep up-to-date. 2018-04-05 01:38:06 +02:00
Jehan ba06a0fe86 Bug 794949 - Plugin crash when opening png, jpeg or tiff with...
... non-latin unicode path.
g_win32_locale_filename_from_utf8() was sometimes returning NULL for
some paths on Windows. Then the call to gexiv2_metadata_open_path() with
a NULL value was crashing plug-ins.
This commit only prevents from crashing by simply failing to load
metadata when this occurs, which means losing metadata support on
Windows depending on filenames. A proper solution will have to be
implemented.
2018-04-05 00:18:28 +02:00
Ell cb239e60f6 app: parallelize gimp-gegl-loops.cc
Ditto.
2018-04-04 17:49:47 -04:00
Ell 828b99b5b3 app: switch gimp-gegl-loops.c to C++
Ditto.
2018-04-04 17:49:47 -04:00
Ell 3df757ffd7 app: parallelize gimppaintcore-loops.cc
Ditto.
2018-04-04 17:49:47 -04:00
Ell e8a14deecf app: switch gimppaintcore-loops.c to C++
Ditto.
2018-04-04 17:49:46 -04:00
Ell c8d4c079a2 app: parallelize gimpbrush-transform.cc
Use gimp_parallel_distribute_foo() to parallelize the brush
transform functions.
2018-04-04 17:49:46 -04:00
Ell 565f1f2aa4 app: switch gimpbrush-transform.c to C++
The next commit is going to parallelize gimpbrush-transform using
the gimp_parallel_distribute_foo() functions.  To spare us a lot of
boilerplate code, we're going to use C++ lambdas as callback
arguments to these functions.

This commit does the initial conversion of gimpbrush-transform.c to
C++, renaming it to gimpbrush-transform.cc.  We do this in a
separate commit, so that the changes are small enough for git to
register this as a renamed file, rather than a new file, so that we
don't lose the file's history.
2018-04-04 17:49:46 -04:00
Ell 86b89cf62a app: add gimp-parallel
Add gimp-parallel.[cc,h], which provides a set of parallel
algorithms.

These currently include:

  - gimp_parallel_distribute():  Calls a callback function in
    parallel on multiple threads, passing it the current thread
    index, and the total number of threads.  Allows specifying the
    maximal number of threads used.

  - gimp_parallel_distribute_range():  Splits a range of integers
    between multiple threads, passing the sub-range to a callback
    function.  Allows specifying the minimal sub-range size.

  - gimp_parallel_distribute_area():  Splits a rectangular area
    between multiple threads, passing the sub-area to a callback
    function.  Allows specifying the minimal sub-area.

The callback function is passed using an appropriately-typed
function pointer, and a user-data pointer.  Additionally, when used
in a C++ file, each of the above functions has an overloaded
template version, taking the callback through a generic parameter,
without a user-data pointer, which allows using function objects.
2018-04-04 17:49:46 -04:00
Ell 700cc33bec configure.ac: require a C++11 compiler
The following commits use C++11 lambdas.
2018-04-04 17:49:46 -04:00
Ell 394c930fbe app: avoid potential division by 0 in dashboard CPU usage sampler 2018-04-04 17:49:46 -04:00
Jehan fa02a2c64f libgimp: add an exception handler for Windows.
Drmingw already added its own exception handler which generates crash
traces in a text file, for plug-ins as well. This additional handler is
run after Drmingw handler and allows us to do things on our own, and in
particular we could display the content of the debug traces.

Right now it simply prints these to stderr, which actually won't be of
much use on Win32, first because the console is deactivated on stable
releases, also because after tests, it doesn't look like even running
GIMP from cmd outputs to console either.

We currently don't use the same debug dialog as the core on purpose,
because we don't want everyone to send us traces for every unmaintained
third party plug-ins out there. But we should definitely allow easier
trace possibilities at some point, first to improve/debug our own core
plug-ins, and also to help third party plug-in developers!
So this commit is not making visible changes yet but is actually a first
step towards these debugging goals.
2018-04-04 20:25:29 +02:00