[graphics/krita/krita/5.0] libs: Add a (hidden) config option to increase frame rendering timeout

Dmitry Kazakov null at kde.org
Wed Jul 7 12:37:46 BST 2021


Git commit d566668edd016870ac294a8f8c79c0a10fceee1a by Dmitry Kazakov.
Committed on 07/07/2021 at 11:37.
Pushed by dkazakov into branch 'krita/5.0'.

Add a (hidden) config option to increase frame rendering timeout

If you see random failures while rendering frames for huge images,
just open kritarc file and add the following option:

frameRenderingTimeout=60000

Where '60000' is the timeout in milliseconds. The default value is
30 seconds and it seems like it is too small for some weird usecases.

CCBUG:438754
CC:kimageshop at kde.org

M  +11   -0    libs/image/kis_image_config.cpp
M  +3    -0    libs/image/kis_image_config.h
M  +6    -3    libs/ui/KisAsyncAnimationRendererBase.cpp

https://invent.kde.org/graphics/krita/commit/d566668edd016870ac294a8f8c79c0a10fceee1a

diff --git a/libs/image/kis_image_config.cpp b/libs/image/kis_image_config.cpp
index 9b6fe746ed..9a0f7553fe 100644
--- a/libs/image/kis_image_config.cpp
+++ b/libs/image/kis_image_config.cpp
@@ -555,6 +555,17 @@ void KisImageConfig::setFrameRenderingClones(int value)
     m_config.writeEntry("frameRenderingClones", value);
 }
 
+int KisImageConfig::frameRenderingTimeout(bool defaultValue) const
+{
+    const int defaultFrameRenderingTimeout = 30000; // 30 ms
+    return defaultValue ? defaultFrameRenderingTimeout : m_config.readEntry("frameRenderingTimeout", defaultFrameRenderingTimeout);
+}
+
+void KisImageConfig::setFrameRenderingTimeout(int value)
+{
+    m_config.writeEntry("frameRenderingTimeout", value);
+}
+
 int KisImageConfig::fpsLimit(bool defaultValue) const
 {
     int limit = defaultValue ? 100 : m_config.readEntry("fpsLimit", 100);
diff --git a/libs/image/kis_image_config.h b/libs/image/kis_image_config.h
index 74c941d6db..4b0d833429 100644
--- a/libs/image/kis_image_config.h
+++ b/libs/image/kis_image_config.h
@@ -108,6 +108,9 @@ public:
     int frameRenderingClones(bool defaultValue = false) const;
     void setFrameRenderingClones(int value);
 
+    int frameRenderingTimeout(bool defaultValue = false) const;
+    void setFrameRenderingTimeout(int value);
+
     int fpsLimit(bool defaultValue = false) const;
     void setFpsLimit(int value);
 
diff --git a/libs/ui/KisAsyncAnimationRendererBase.cpp b/libs/ui/KisAsyncAnimationRendererBase.cpp
index 7da1bd6a63..694b160552 100644
--- a/libs/ui/KisAsyncAnimationRendererBase.cpp
+++ b/libs/ui/KisAsyncAnimationRendererBase.cpp
@@ -12,6 +12,8 @@
 #include "kis_image.h"
 #include "kis_image_animation_interface.h"
 #include "kis_signal_auto_connection.h"
+#include "kis_image_config.h"
+
 
 struct KRITAUI_NO_EXPORT KisAsyncAnimationRendererBase::Private
 {
@@ -23,8 +25,6 @@ struct KRITAUI_NO_EXPORT KisAsyncAnimationRendererBase::Private
     int requestedFrame = -1;
     bool isCancelled = false;
     KisRegion requestedRegion;
-
-    static const int WAITING_FOR_FRAME_TIMEOUT = 30000;
 };
 
 KisAsyncAnimationRendererBase::KisAsyncAnimationRendererBase(QObject *parent)
@@ -32,8 +32,11 @@ KisAsyncAnimationRendererBase::KisAsyncAnimationRendererBase(QObject *parent)
       m_d(new Private())
 {
     connect(&m_d->regenerationTimeout, SIGNAL(timeout()), SLOT(slotFrameRegenerationCancelled()));
+
+    KisImageConfig cfg(true);
+
     m_d->regenerationTimeout.setSingleShot(true);
-    m_d->regenerationTimeout.setInterval(Private::WAITING_FOR_FRAME_TIMEOUT);
+    m_d->regenerationTimeout.setInterval(cfg.frameRenderingTimeout());
 }
 
 KisAsyncAnimationRendererBase::~KisAsyncAnimationRendererBase()



More information about the kimageshop mailing list