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++
Fix a crash when switching openGL filtering with OCIO enabled
Dmitry Kazakovb491db1ccc7e
diff --git a/libs/ui/opengl/KisOpenGLCanvasRenderer.cpp b/libs/ui/opengl/KisOpenGLCanvasRenderer.cppindex 58ba854341..f9153aa038 100644--- a/libs/ui/opengl/KisOpenGLCanvasRenderer.cpp+++ b/libs/ui/opengl/KisOpenGLCanvasRenderer.cpp@@ -199,7 +199,7 @@ void KisOpenGLCanvasRenderer::setDisplayFilterImpl(QSharedPointer<KisDisplayFiltbool needsInternalColorManagement =!displayFilter || displayFilter->useInternalColorManagement();- bool needsFullRefresh = d->openGLImageTextures->setInternalColorManagementActive(needsInternalColorManagement);+ bool needsFullRefresh = d->openGLImageTextures->setInternalColorManagementActive(needsInternalColorManagement, initializing);d->displayFilter = displayFilter;diff --git a/libs/ui/opengl/kis_opengl_image_textures.cpp b/libs/ui/opengl/kis_opengl_image_textures.cppindex 83630adbd2..f45e5b05c2 100644--- a/libs/ui/opengl/kis_opengl_image_textures.cpp+++ b/libs/ui/opengl/kis_opengl_image_textures.cpp@@ -536,13 +536,19 @@ bool KisOpenGLImageTextures::internalColorManagementActive() constreturn m_internalColorManagementActive;}-bool KisOpenGLImageTextures::setInternalColorManagementActive(bool value)+bool KisOpenGLImageTextures::setInternalColorManagementActive(bool value, bool initializing){bool needsFinalRegeneration = m_internalColorManagementActive != value;if (needsFinalRegeneration) {m_internalColorManagementActive = value;- recreateImageTextureTiles();++ if (!initializing) {+ // During initialization process the textures might be not ready yet,+ // so we shouldn't try to recreate them. They will be created during+ // the initGL() call later.+ recreateImageTextureTiles();+ }// at this point the value of m_internalColorManagementActive might// have been forcefully reverted to 'false' in case of some problemsdiff --git a/libs/ui/opengl/kis_opengl_image_textures.h b/libs/ui/opengl/kis_opengl_image_textures.hindex 3ef10c5261..37a77b5403 100644--- a/libs/ui/opengl/kis_opengl_image_textures.h+++ b/libs/ui/opengl/kis_opengl_image_textures.h@@ -89,7 +89,7 @@ public:void setProofingConfig(KisProofingConfigurationSP);bool internalColorManagementActive() const;- bool setInternalColorManagementActive(bool value);+ bool setInternalColorManagementActive(bool value, bool iniializing = false);/*** The background checkers texture.