Skip to content

armgit / krita

Public Imported from GitHub
0

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++

Improve color management information report

Dmitry Kazakov3e436896ecf5
diff --git a/libs/ui/KisCanvasSurfaceColorSpaceManager.cpp b/libs/ui/KisCanvasSurfaceColorSpaceManager.cpp
index 06caa7ce19..f792d96f2e 100644
--- a/libs/ui/KisCanvasSurfaceColorSpaceManager.cpp
+++ b/libs/ui/KisCanvasSurfaceColorSpaceManager.cpp
@@ -42,6 +42,11 @@ QString KisCanvasSurfaceColorSpaceManager::colorManagementReport() const
str << "(canvas surface color manager)" << Qt::endl;
str << Qt::endl;
+ if (!m_interface->isReady()) {
+ str << "WARNING: surface color management interface is not ready!" << Qt::endl;
+ str << Qt::endl;
+ }
+
using KisSurfaceColorimetry::RenderIntent;
using KisSurfaceColorimetry::SurfaceDescription;
using KisSurfaceColorimetry::NamedPrimaries;
diff --git a/libs/ui/KisMainWindow.cpp b/libs/ui/KisMainWindow.cpp
index 29993e4d0d..62484f3be7 100644
--- a/libs/ui/KisMainWindow.cpp
+++ b/libs/ui/KisMainWindow.cpp
@@ -3249,9 +3249,9 @@ QString KisMainWindow::colorManagementReport() const
#if KRITA_USE_SURFACE_COLOR_MANAGEMENT_API
return d->surfaceColorSpaceManager ?
d->surfaceColorSpaceManager->colorManagementReport() :
- QString("Surface color management is not supported on this platform");
+ QString("Surface color management is not supported on this platform\n");
#else
- return "Surface color management is disabled";
+ return "Surface color management is disabled\n";
#endif
}
diff --git a/libs/ui/KisSRGBSurfaceColorSpaceManager.cpp b/libs/ui/KisSRGBSurfaceColorSpaceManager.cpp
index 90488feed2..b9eeaa5d19 100644
--- a/libs/ui/KisSRGBSurfaceColorSpaceManager.cpp
+++ b/libs/ui/KisSRGBSurfaceColorSpaceManager.cpp
@@ -33,6 +33,11 @@ QString KisSRGBSurfaceColorSpaceManager::colorManagementReport() const
str << "(sRGB surface color manager)" << Qt::endl;
str << Qt::endl;
+ if (!m_interface->isReady()) {
+ str << "WARNING: surface color management interface is not ready!" << Qt::endl;
+ str << Qt::endl;
+ }
+
using KisSurfaceColorimetry::RenderIntent;
using KisSurfaceColorimetry::SurfaceDescription;
using KisSurfaceColorimetry::NamedPrimaries;
diff --git a/libs/ui/canvas/kis_canvas2.cpp b/libs/ui/canvas/kis_canvas2.cpp
index 43cf1dc777..816a7931e4 100644
--- a/libs/ui/canvas/kis_canvas2.cpp
+++ b/libs/ui/canvas/kis_canvas2.cpp
@@ -1545,8 +1545,8 @@ QString KisCanvas2::colorManagementReport() const
#if KRITA_USE_SURFACE_COLOR_MANAGEMENT_API
return m_d->surfaceColorManager ?
m_d->surfaceColorManager->colorManagementReport() :
- QString("Surface color management is not supported on this platform");
+ QString("Surface color management is not supported on this platform\n");
#else
- return "Surface color management is disabled";
+ return "Surface color management is disabled\n";
#endif
}
diff --git a/plugins/extensions/buginfo/DlgColorManagementInfo.cpp b/plugins/extensions/buginfo/DlgColorManagementInfo.cpp
index c6cab8049d..58d79c23b9 100644
--- a/plugins/extensions/buginfo/DlgColorManagementInfo.cpp
+++ b/plugins/extensions/buginfo/DlgColorManagementInfo.cpp
@@ -37,6 +37,8 @@ QString DlgColorManagementInfo::replacementWarningText()
return "";
}
+#include <QWindow>
+
#include <KisViewManager.h>
#include <KisDocument.h>
#include <kis_canvas2.h>
@@ -46,24 +48,40 @@ QString DlgColorManagementInfo::infoText(QSettings& kritarc)
Q_UNUSED(kritarc)
QString report;
- QTextStream s(&report);
+ QDebug s(&report);
s << "Main Window" << Qt::endl;
s << "===" << Qt::endl;
s << Qt::endl;
KisMainWindow *mainWindow = qobject_cast<KisMainWindow*>(parent());
- s << mainWindow->colorManagementReport();
+
+ s << "Native window handle:" << mainWindow->windowHandle() << Qt::endl;
+ s << Qt::endl;
+
+ s.noquote().nospace() << mainWindow->colorManagementReport();
+ s << Qt::endl;
if (mainWindow->viewManager()->document()) {
auto *doc = mainWindow->viewManager()->document();
auto *canvas = mainWindow->viewManager()->canvasBase();
- s << "Document: " << doc->objectName() << " path: " << doc->localFilePath() << Qt::endl;
+ s << "Document:" << doc->objectName() << "path:" << doc->localFilePath() << Qt::endl;
s << "===" << Qt::endl;
s << Qt::endl;
- s << canvas->colorManagementReport();
+ s << "Native window handle:" << canvas->canvasWidget()->windowHandle() << Qt::endl;
+
+
+ if (mainWindow->managedSurfaceProfile() &&
+ canvas->canvasWidget()->windowHandle() == mainWindow->windowHandle()) {
+
+ s << "WARNING: the canvas shares the surface with the main window on a platform with managed surface color space!";
+ }
+ s << Qt::endl;
+
+
+ s.noquote().nospace() << canvas->colorManagementReport();
}
return report;