Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Try to fix slowdown with reference images in qt5.
Wolthera van Hövell tot Westerflier54119dc61bbc
diff --git a/libs/pigment/KoColorSpaceRegistry.cpp b/libs/pigment/KoColorSpaceRegistry.cppindex 1f68d249b8..5efc41ecbf 100644--- a/libs/pigment/KoColorSpaceRegistry.cpp+++ b/libs/pigment/KoColorSpaceRegistry.cpp@@ -750,6 +750,7 @@ static QMap<QColorSpace::TransferFunction, TransferCharacteristics> mapQColorSpaconst KoColorProfile *KoColorSpaceRegistry::profileForQColorSpace(const QColorSpace &space){+ if (!space.isValid()) return p709SRGBProfile();const KoColorProfile *profile = nullptr;#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)ColorPrimaries primaries = mapQColorSpaceColorPrimaries.value(space.primaries(), PRIMARIES_UNSPECIFIED);diff --git a/libs/ui/KisReferenceImagesDecoration.cpp b/libs/ui/KisReferenceImagesDecoration.cppindex 40fb7a7236..596a48ce32 100644--- a/libs/ui/KisReferenceImagesDecoration.cpp+++ b/libs/ui/KisReferenceImagesDecoration.cpp@@ -150,7 +150,8 @@ void KisReferenceImagesDecoration::drawDecoration(QPainter &gc, const QRectF &/*#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)gc.drawImage(d->buffer.position, d->buffer.image);#else- gc.drawImage(d->buffer.position, canvas->displayRendererInterface()->convertImageToDisplayColorSpace(d->buffer.image));+ // In qt5, don't bother trying to fix the buffer cs, as this slows things down too much.+ gc.drawImage(d->buffer.position, d->buffer.image);#endif}}