Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 9ae336ed authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Cache the color space engine to make it faster

It doesn't fix everything, but it fixes quite a bit.
Ref T210
parent d4358901
...@@ -67,6 +67,7 @@ KoColorSpace::KoColorSpace(const QString &id, const QString &name, KoMixColorsOp ...@@ -67,6 +67,7 @@ KoColorSpace::KoColorSpace(const QString &id, const QString &name, KoMixColorsOp
d->TRCXYY = QPolygonF(); d->TRCXYY = QPolygonF();
d->colorants = QVector <qreal> (0); d->colorants = QVector <qreal> (0);
d->lumaCoefficients = QVector <qreal> (0); d->lumaCoefficients = QVector <qreal> (0);
d->iccEngine = 0;
d->deletability = NotOwnedByRegistry; d->deletability = NotOwnedByRegistry;
} }
...@@ -451,10 +452,12 @@ bool KoColorSpace::proofPixelsTo(const quint8 * src, ...@@ -451,10 +452,12 @@ bool KoColorSpace::proofPixelsTo(const quint8 * src,
}*/ }*/
// Only the icc engine can do this kind of stuff // Only the icc engine can do this kind of stuff
//Can we cache this, maybe??? //Can we cache this, maybe???
KoColorSpaceEngine *engine = KoColorSpaceEngineRegistry::instance()->get("icc"); if (d->iccEngine) {
//qDebug() << ">>>>>>>>>>>>>>>>>>>> we got a proofing engine"; d->iccEngine = KoColorSpaceEngineRegistry::instance()->get("icc");
if (!engine) return false; //qDebug() << ">>>>>>>>>>>>>>>>>>>> we got a proofing engine";
KoColorConversionTransformation *transform = engine->createColorProofingTransformation(this, dstColorSpace, proofingSpace, renderingIntent, conversionFlags); }
if (!d->iccEngine) return false;
KoColorConversionTransformation *transform = d->iccEngine->createColorProofingTransformation(this, dstColorSpace, proofingSpace, renderingIntent, conversionFlags);
Q_UNUSED(transform); Q_UNUSED(transform);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#define _KOCOLORSPACE_P_H_ #define _KOCOLORSPACE_P_H_
#include "KoColorSpace.h" #include "KoColorSpace.h"
#include "KoColorSpaceEngine.h"
#include <QThreadStorage> #include <QThreadStorage>
#include <QPolygonF> #include <QPolygonF>
...@@ -45,6 +46,8 @@ struct Q_DECL_HIDDEN KoColorSpace::Private { ...@@ -45,6 +46,8 @@ struct Q_DECL_HIDDEN KoColorSpace::Private {
QVector <qreal> colorants; QVector <qreal> colorants;
QVector <qreal> lumaCoefficients; QVector <qreal> lumaCoefficients;
KoColorSpaceEngine *iccEngine;
Deletability deletability; Deletability deletability;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment