gimp/app/operations/layer-modes-legacy
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
..
.gitignore app: start moving layer modes into their own build directories 2017-01-09 21:58:18 +01:00
Makefile.am app: rename "Color (HSV) (legacy)" mode to "Color (HSL) (legacy)" 2017-03-16 06:23:30 -04:00
gimpoperationadditionlegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationadditionlegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationburnlegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationburnlegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationdarkenonlylegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationdarkenonlylegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationdifferencelegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationdifferencelegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationdividelegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationdividelegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationdodgelegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationdodgelegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationgrainextractlegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationgrainextractlegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationgrainmergelegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationgrainmergelegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationhardlightlegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationhardlightlegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationhslcolorlegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationhslcolorlegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationhsvhuelegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationhsvhuelegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationhsvsaturationlegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationhsvsaturationlegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationhsvvaluelegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationhsvvaluelegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationlightenonlylegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationlightenonlylegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationmultiplylegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationmultiplylegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationscreenlegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationscreenlegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationsoftlightlegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationsoftlightlegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationsubtractlegacy.c app: layer mode code shuffling 2017-08-17 11:19:37 -04:00
gimpoperationsubtractlegacy.h app: layer mode code shuffling 2017-08-17 11:19:37 -04:00