Commit Graph

43368 Commits

Author SHA1 Message Date
Ell 91f4c809d8 app: more responsiveness improvements to GimpChunkIterator
Improve GimpChunkIterator's responsiveness to changes in processing
speed.
2019-03-30 11:18:00 -04:00
Piotr Drąg 5ab08b72a9 Update Polish translation 2019-03-30 14:35:20 +01:00
Ell 9dabad4cb9 app: don't invalidate viewable preview when thawed unless explicitly requested
In GimpViewable, don't invalidate the preview when thawed, unless
there was an explicit call to gimp_viewable_invalidate_preview()
while it was frozen.  This avoids invalidating the previews of an
invisible drawable's ancestors when the drawable's preview is
frozen/thawed.
2019-03-29 04:54:07 -04:00
Ell 24ed9dbdf5 app: avoid risky alloca() in gimp_brush_save()
Replace an arbitrarily-sized g_alloca() with g_malloc() in
gimp_brush_save().
2019-03-28 16:55:55 -04:00
Ell de36e33347 app: avoid freezing image preview if drawable is not attached
When freezing/thawing a top-level drawable's preview, only freeze/
thaw the image preview if the drawable is attached.
2019-03-28 12:36:44 -04:00
Ell e2ea2e4a82 app: when freezing a drawable's preview, freeze ancestors' previews
Add GimpViewable::preview_{freeze,thaw}() virtual functions, which
get called when the viewable's preview is frozen/thawed.  Implement
the functions in GimpDrawable, recursively freezing the parent
drawable's preview (or the image's preview, for top-level
drawables) while the drawable's preview is frozen.  For layer
masks, freeze the associated layer's parent.

This avoids updating layer-group/image previews while painting on,
or applying a filter to, a descendant layer.  This both reduces
lag, and fixes a discrepancy between the layer's preview, which
isn't updated, and its parents' previews.
2019-03-28 12:26:44 -04:00
Jehan d821b088e2 app: change antialias feature in fill by line art into Feather Edges.
This was actually more of a feathering feature I added earlier, and we
already have a function for that: gimp_gegl_apply_feather(). This is
using a gaussian blur, just as what I was doing anyway. This commit also
adds the "Feather Radius" scale, similar to other tools with the
"Feather Edges". So that makes it consistent (and more useful as you can
adapt to your needs).
2019-03-28 14:06:17 +01:00
Ell 1846764d3b app: include system gimp.css file in theme.css
Include the system-wide gimp.css file, in addition to the user-
specific gimp.css file, in the generated theme.css file, instead of
copying the former into the latter when creating the user's
gimpdir.  This allows us to modify the system-wide gimp.css file,
and having the changes take effect in existing installations.
2019-03-27 20:14:10 -04:00
Ell 846d242f30 app: revert combo-box drop-down changes
Revert the use of gtk_combo_box_set_wrap_width() to change the
combo-box drop-down style, except for the status-bar unit combo.
See https://gitlab.gnome.org/GNOME/gimp/issues/2828#note_421312 for
the rationale.

This reverts commits 1d984542e9,
68a33ab5bd, and
6dfca83c2a.
2019-03-27 20:14:10 -04:00
Ell 234f76b6fb app: use gimp:fill-source in gimp_drawable_edit_fill()
In gimp_drawable_edit_fill(), when performing a non-direct fill,
use a GimpDrawableFilter with gimp:fill-source, added in the
previous commit, instead of using gimp_drawable_apply_buffer() with
an intermediate fill buffer.  This avoids allocating a full-size
fill buffer, which may occupy a lot of space in pattern fills.
2019-03-27 15:45:59 -04:00
Ell 6b0337e384 app: add gimp:fill-source operation
Add a new gimp:fill-source operation, which can act as a source
node for fill operations, instead of a fill buffer.  The op takes
a GimpFillOptions object, a drawable, and a pattern offset, and
uses gimp_fill_options_create_buffer() to produce its output.

This allows performing the entire fill operation in chunks as a
graph, instead of allocating a full-size fill buffer, which can
can occupy a lot of space for pattern fills.
2019-03-27 15:45:59 -04:00
Ell 3c1634ee0d app: improve gimp_drawable_fill_buffer() for patterns
In gimp_drawable_fill_buffer(), when the fill-source is a pattern,
avoid going through an intermediate buffer when there's no profile
transform, and use the destination-buffer format for the
intermediate buffer, instead of the pattern format, when there is a
profile transform.
2019-03-27 15:45:58 -04:00
Ell 245a17c79f app: use compositing format for fill buffer
Add gimp_fill_options_get_format(), which returns the format to be
used for the fill buffer; this is the same format used during
compositing.  Use this format in gimp_fill_options_create_buffer(),
instead of the drawable format.

This fixes the result of fill operations when the fill color/
pattern is not representable in the drawable format, and speeds up
color fills by avoiding color-conversion for the fill buffer during
processing.
2019-03-27 15:45:58 -04:00
Ell b0dfc1e7c7 app: in GimpDrawableFilter, set underlying operation
In GimpDrawableFilter, use
gimp_gegl_node_set_underlying_operation() to the the input
operation node as the underlying operation of the filter node.
2019-03-27 15:45:57 -04:00
Ell 213b126c6e app: use underlying operation in gimp_gegl_apply_cached_operation()
In gimp_gegl_apply_cached_operation(), use the underlying
operation, as returned from
gimp_gegl_node_get_underlying_operation(), for testing whether the
operation is a point operation, for the purpose of avoiding
duplicating the input buffer.  Likewise, avoid duplicating the
buffer when the underlying operation is a source operation.
2019-03-27 15:45:57 -04:00
Ell eb5e473665 app: add gimp_gegl_node_{set,get}_underlying_oepration()
... which allow setting/getting the "underlying operation" node of
a graph node.  For example, GimpDrawableFilter constructs a complex
graph around a given operation node, which would be the underlying
operation of the graph.  This allows querying the properties of the
underlying operation, given only the graph.

In recursive cases, gimp_gegl_node_get_underlying_operation()
returns the most-nested underlying operation; when no underlying
operation has been set, gimp_gegl_node_get_underlying_operation()
returns the input node.
2019-03-27 15:45:55 -04:00
Ell ff13e55c16 app: add gimp_gegl_node_is_source_operation()
... which determines if a node is a source operation.
2019-03-27 15:45:31 -04:00
Ell 8f845d3a51 app: in gimp_drawable_apply_buffer(), work in chunks
In gimp_drawable_real_apply_buffer(), use GimpChunkIterator to blit
the applicator's output to the drawable's buffer in chunks, to
minimize the space used for intermediate results.
2019-03-27 15:45:30 -04:00
Ell e904b71242 app: improve responsiveness of GimpChunkIterator
In GimpChunkIterator, redajust the target area at each step,
instead of at each iteration, to adapt more quickly to the current
processing speed.  To avoid creating uneven chunks as a result,
only change the chunk height at the beginning of rows, unless the
resulting area would be more than twice as big as the target area.
2019-03-27 15:45:30 -04:00
Ell 9d80ccc3e6 app: preserve projection priority rect across structure/bounds changes
In GimpProjection, store the priority rect in image coordinates,
and only convert it to projectable coordinates when initializing
the chunk-iterator's priority rect.  This allows us to preserve the
priority rect across projectable structure/bounds changes.
2019-03-26 04:58:51 -04:00
Dimitris Spingos b2969a11e1 Updated Greek translation 2019-03-25 20:08:43 +02:00
Ell 30da2f3d6f app: don't disable filter format conversion if != drawable format
In gimp_drawable_merge_filter(), don't disable the filter
applicator's output-format conversion node if the output format is
different than the drawable's format, since it may change the
result.
2019-03-25 09:16:23 -04:00
Ell 733a6ec01c app: skip cache and format conversion when merging a drawable filter
In gimp_drawable_merge_filter(), disable the filter applicator's
cache and output-format conversion nodes before processing the
uncached region of the filter, so that the result is written
directly to the drawable's buffer.
2019-03-25 09:02:27 -04:00
Ell d4689441fe app: small fix to gimp_gegl_mask_combine_ellipse_rect() 2019-03-24 14:45:45 -04:00
Ell 106df3b794 Issue #3142 - Filters on-canvas preview doesn't work ...
... immediately after an image precision change

When flushing a projection, make sure it has a buffer, instead of
bailing if it doesn't.  We rely on the image projection's "update"
signal to update the display after certain operations that free the
buffer, which would previously fail to happen, and cause subsequent
flushes to be ignored until the buffer is explicitly accessed.

This fixes commit b07f810273.
2019-03-24 03:20:39 -04:00
Martin Srebotnjak 23b5d503a8 Updated Slovenian translation 2019-03-22 21:49:54 +01:00
Martin Srebotnjak 2ec3ec98b7 Updated Slovenian translation 2019-03-22 21:49:18 +01:00
Martin Srebotnjak 369382c862 Updated Slovenian translation 2019-03-22 21:43:09 +01:00
Martin Srebotnjak 79e1c9668e Updated Slovenian translation 2019-03-22 21:40:43 +01:00
Martin Srebotnjak d1e4969ec4 Updated Slovenian translation 2019-03-22 21:28:38 +01:00
Ell a712308f20 Issue #3134 - Deleting last layer of group not updating image
In gimp_group_layer_get_size(), make sure to always set *width and
*height, even when the group is empty, so that when the function is
called through gimp_projectable_get_size() by the group's
projection, the correct size is reported.  This makes sure we
update the correct area when the group becomes empty.
2019-03-20 17:48:47 -04:00
Ell 8e77347cac app: improve gimpchannel-{combine,select}
In gimpchannel-select, move some of the common functionality of the
various gimp_channel_select_foo() functions to gimpchannel-combine.
Furthermore, don't special-case CHANNEL_OP_INTERSECT, but rather
pass it over to gimpchannel-combine, which is now prepared to
handle it in all functions, as per the previous commits.

In gimpchannel-combine, factor out the common functionality of the
various gimp_channel_combine_foo() functions into a pair of
gimp_channel_combine_{start,end}() functions, which are called
before/after the actual gimp_gegl_mask_combine_foo() function,
respectively.  In particular, these functions deal with calculating
the new channel bounds.  Previously, the various
gimp_gegl_mask_combine_foo() functions would implicitly invalidate
the channel bounds (since commit
d0ae244fe8), rendering the bounds-
recalculation code ineffective.  This avoids manually recalculating
the bounds in many cases, speeding up selection operations.
2019-03-20 16:24:37 -04:00
Ell a227c8e94d app: improve gimp_gegl_mask_combine_buffer()
Simplify code, use gimp_gegl_buffer_copy() for CHANNEL_OP_REPLACE
when possible, improve value clipping, and parallelize processing.
2019-03-20 16:01:57 -04:00
Ell 1044342393 app: improve gimp_gegl_mask_combine_ellipse[_rect]()
Improve gimp_gegl_mask_combine_ellipse_rect() -- the funciton
responsible for rendering ellipse/rounded-rectangle selections.

Most notably, this commit significantly improves the function's
performance, by identifying whole tiles, whole rows, or parts of a
row, that are fully inside, or fully outside, the ellipse, and
filling them in bulk, instead of calculating the anti-aliasing
value at each pixel, which is now only done along the
circumference.

This commit also improves anti-aliasing, by more accurately
approximating the distance from a pixel to the ellipse, and by
normalizing the distance according to the pixel's cross-section
length in the direction of the said point.  In particular, we
guarantee that pixels that are fully inside/outside the ellipse
have a value of 1/0, respectively, facilitating the aforementioned
optimization.

Additionally, this commit fixes various edge cases where several
primitives coincide at a single pixel (in the rounded-rectangle
case), adds support for CHANNEL_OP_INTERSECT, and parallelizes
processing.
2019-03-20 15:58:29 -04:00
Ell 8a6e1c907d app: improve gimp_gegl_mask_combine_rect()
Simplify the code, and add support for CHANNEL_OP_INTERSECT.
2019-03-20 15:58:29 -04:00
Ell 5198d3c32d app: convert gimp-gegl-mask-combine to C++
... in preparation for next commits.
2019-03-20 15:58:28 -04:00
Ell ffaaa81c8a app: add gimp_babl_format_change_{component_type,trc}()
... which change a format's component-type/TRC, without otherwise
affecting it.
2019-03-20 15:57:05 -04:00
Ell d7f12c9d26 app: add gimp_babl_is_bounded()
... which takes a GimpPrecision, and determines if its values are
bounded to the [0,1] range (which is currently only true for
integer precisions).
2019-03-20 15:50:35 -04:00
Jehan 9042e85f3c app: make gimp_prop_gui_chain_toggled() less error-prone.
Don't assume that "toggled" signal means that toggle status actually
changed.

Though issue #3133 got fixed with my previous commit, let's make sure we
never create several GBinding for the same GimpChain by always checking
existence of a previous one after a "toggled" signal.
Also only create a GBinding object if one doesn't already exist.
2019-03-20 15:05:22 +01:00
Jehan 03dc24455a Issue #3133: Gimp freezes after selecting a filter preset and...
... clicking a GimpChain.
Since commit c0c055b4e9, gimp_chain_button_set_active() emits the
"toggled" signal. There is no need to emit it separately from
GimpOperationTool when setting presets with
gimp_operation_tool_set_config().

In particular, since the "toggled" signal was even sent unconditionnally
here, our code was ending creating several GBinding for the same 2
adjustments, which was creating an infinite loop.
2019-03-20 14:48:40 +01:00
Jehan af6760b3c9 app: fixes g_object_unref: assertion 'G_IS_OBJECT (object)' failed.
"binding" data can be set to NULL. Do not assume it is a proper object.

Also I was tempted to use g_object_set_data() to simply free the
GBinding object on setting a new data, but such object will also be
freed when the widget is destroyed by default. So that would also end up
in double destruction. Instead just keep current logics.

This CRITICAL was reported in #3133 but this is not the main bug.
2019-03-20 14:06:18 +01:00
Jehan 7cf06c3f60 app: color widget updated properly when editing colors.
Also note that GimpColorPanel doesn't need to react differently whether
GimpColorDialog returned OK or CANCEL, as the dialog keep track and
return the appropriate color to set in the end of the process.
2019-03-20 11:21:46 +01:00
Jehan 4dcda7ffb8 Issue #3129: Split sentence on gimpexport.c. 2019-03-19 22:29:04 +01:00
Jehan 425eb83f8a app: GimpColorDialog follows the user context active image.
(when working in context-aware mode)
2019-03-19 13:37:18 +01:00
Jehan 0b68ce8182 plug-ins: do not needlessly free/malloc() buffer of same size.
In an animated WebP, chances that layers/frame have the same size is
high. It is uneeded to free then malloc again a buffer at each frame,
unless we need more allocated memory.
This is probably not so significant, but still feels nicer.
2019-03-19 12:46:12 +01:00
Jehan 3dc820c017 app: make active_image member a weak pointer in GimpColorDialog.
This fixes signal handler disconnections wrongly run on images which
have already been freed.
2019-03-18 23:36:31 +01:00
Piotr Drąg 1c6fb83308 Update POTFILES.in 2019-03-18 19:11:28 +01:00
Jehan 0ae3f38f52 Issue #3122: gimp_color_dialog_constructed: 'colormap' action group...
... not found.
So it turns out I cannot just gtk_action_group_get_action("colormap") as
the related action group is not registered unless the Colormap dockable
is opened. Anyway I mostly needed to get icons and tooltips from these
actions. Let's just copy the strings and be done with it.
This still feel a bit like duplicate code but it's not too bad, so…
2019-03-18 17:57:08 +01:00
Jehan ed3bcf248e plug-ins: remove old spyrogimp.
Spyrogimp has been rewritten in Python with more features.

Note: this commit should not be backported to gimp-2-10 since we will
keep the old plug-in around (in case its API is used by older scripts in
particular). But let's turn over a new leaf with future GIMP 3 and only
keep the new plug-in.
2019-03-18 15:53:04 +01:00
Jehan 3b0e4d8760 app: update padding color interactively.
We should see the padding color change as we tweak the color dialog to
make it more useful.
2019-03-18 14:58:05 +01:00