diff options
author | Robin Watts <Robin.Watts@artifex.com> | 2019-08-13 11:54:36 +0100 |
---|---|---|
committer | Robin Watts <Robin.Watts@artifex.com> | 2019-08-13 19:04:06 +0100 |
commit | 8b5af0e2db28be36d96de97eb1a145d5716ffea3 (patch) | |
tree | f3a2fdd7b67b5e1883df5e6585357ccbf1c46fd7 /lcms2mt | |
parent | 15d95340389f0f46bd214803ec19685c0a738a0e (diff) | |
download | ghostpdl-8b5af0e2db28be36d96de97eb1a145d5716ffea3.tar.gz |
Tweak lcms to optimise the pipeline before consulting plugins.
This allows us to recognise identity transforms before selecting
one of our optimised lookup functions. Firstly, however optimised
our code is, we aren't going to beat the identity code. Secondly,
lcms doesn't calculate the tables for identity transforms, so
our code can fall in a heap here.
Diffstat (limited to 'lcms2mt')
-rw-r--r-- | lcms2mt/src/cmsxform.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lcms2mt/src/cmsxform.c b/lcms2mt/src/cmsxform.c index 56f584961..52f4815ab 100644 --- a/lcms2mt/src/cmsxform.c +++ b/lcms2mt/src/cmsxform.c @@ -1138,6 +1138,11 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsPipeline* lut, // Let's see if any plug-in want to do the transform by itself if (core->Lut != NULL) { + // First, optimise the pipeline. This may cause us to recognise that the Luts are + // identity. + _cmsOptimizePipeline(ContextID, &core->Lut, Intent, InputFormat, OutputFormat, dwFlags); + + if (_cmsLutIsIdentity(core->Lut) == FALSE) { for (Plugin = ctx->TransformCollection; Plugin != NULL; Plugin = Plugin->Next) { @@ -1170,9 +1175,8 @@ _cmsTRANSFORM* AllocEmptyTransform(cmsContext ContextID, cmsPipeline* lut, return p; } } + } - // Not suitable for the transform plug-in, let's check the pipeline plug-in - _cmsOptimizePipeline(ContextID, &core->Lut, Intent, InputFormat, OutputFormat, dwFlags); } // Check whatever this is a true floating point transform |