summaryrefslogtreecommitdiff
path: root/toolkit
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-05-30 17:36:37 +0200
committerJan Holesovsky <kendy@collabora.com>2016-05-31 15:26:59 +0200
commit5acdf13b21e52e3c26657d063a9b327006bc5494 (patch)
treeed552a9ba856082e85944f45477cca370bc3ae5d /toolkit
parent407c675229e803ce1038384c233e3dc028d786e0 (diff)
tdf#100092: Deterministic scheduling to prevent unpredictable behavior.
Low priority idles can fire more or less randomly, and consequently two consequent runs of LibreOffice differ in the amount of the idles that have been performed during an operation. This commit adds a possibility to turn on a 'deterministic mode' where two subsequent runs of LibreOffice trigger about the same amount of events when they perform the same set of operations. Change-Id: I92566ef4eee20e7d604cfd48f01c4df30c77e653
Diffstat (limited to 'toolkit')
-rw-r--r--toolkit/source/awt/vclxtoolkit.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index c99030cabecf..2dfa25cf13cb 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -202,6 +202,9 @@ public:
virtual sal_Int64 SAL_CALL getOpenGLBufferSwapCounter()
throw (css::uno::RuntimeException, std::exception) override;
+ virtual void SAL_CALL setDeterministicScheduling(sal_Bool bDeterministicMode)
+ throw (css::uno::RuntimeException, std::exception) override;
+
// css::awt::XToolkit
css::uno::Reference< css::awt::XWindowPeer > SAL_CALL getDesktopWindow( ) throw(css::uno::RuntimeException, std::exception) override;
css::awt::Rectangle SAL_CALL getWorkArea( ) throw(css::uno::RuntimeException, std::exception) override;
@@ -1926,12 +1929,19 @@ sal_Int64 SAL_CALL VCLXToolkit::getOpenGLBufferSwapCounter()
throw (css::uno::RuntimeException, std::exception)
{
#if HAVE_FEATURE_OPENGL
- return OpenGLWrapper::getBufferSwapCounter();
+ return OpenGLWrapper::getBufferSwapCounter();
#else
- return 0;
+ return 0;
#endif
}
+void SAL_CALL VCLXToolkit::setDeterministicScheduling(sal_Bool bDeterministicMode)
+ throw (css::uno::RuntimeException, std::exception)
+{
+ SolarMutexGuard aSolarGuard;
+ Scheduler::SetDeterministicMode(bDeterministicMode);
+}
+
// css:awt:XToolkitRobot
void SAL_CALL VCLXToolkit::keyPress( const css::awt::KeyEvent & aKeyEvent )