diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2016-08-10 12:00:53 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2017-07-13 12:10:28 +0200 |
commit | 00aa0892e7385cd8395dd39814077958be42e720 (patch) | |
tree | fb12e4f87b1466e7261640a4b3a597c9c3981eba /vcl | |
parent | 11ffb51b758cd18a2c61d4bfa694f9f031ecd096 (diff) |
Reorganize Scheduler priority classes
This is based on glibs classification of tasks, but while glib uses
an int for more fine grained priority, we stay with our enum.
1. Timers start with DEFAULT priority, which directly corresponds
with the previous HIGH priority
2. Idles start with DEFAULT_IDLE priority instead of the previous
HIGH priority, so idle default becomes "really run when idle".
As RESIZE and REPAINT are special, and the DEFAULTS are set, there
is just one primary decision for the programmer: should my idle
run before paint (AKA HIGH_IDLE)?
If we really need a more fine-grained classification, we can add it
later, or also switch to a real int. As a result, this drops many
classifications from the code and drastically changes behaviour,
AKA a mail merge from KDE is now as fast as Gtk+ again.
Change-Id: I498a73fd02d5fb6f5d7e9f742f3bce972de9b1f9
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/osx/salinst.cxx | 1 | ||||
-rw-r--r-- | vcl/source/app/idle.cxx | 3 | ||||
-rw-r--r-- | vcl/source/app/scheduler.cxx | 2 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 2 | ||||
-rw-r--r-- | vcl/source/app/timer.cxx | 2 | ||||
-rw-r--r-- | vcl/source/edit/textdata.cxx | 2 | ||||
-rw-r--r-- | vcl/source/uitest/uno/uiobject_uno.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/dockmgr.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/dockwin.cxx | 2 |
9 files changed, 9 insertions, 11 deletions
diff --git a/vcl/osx/salinst.cxx b/vcl/osx/salinst.cxx index bff9c3816d22..f06504cc9678 100644 --- a/vcl/osx/salinst.cxx +++ b/vcl/osx/salinst.cxx @@ -108,7 +108,6 @@ void AquaSalInstance::delayedSettingsChanged( bool bInvalidate ) { osl::Guard< comphelper::SolarMutex > aGuard( *mpSalYieldMutex ); AquaDelayedSettingsChanged* pIdle = new AquaDelayedSettingsChanged( bInvalidate ); - pIdle->SetPriority( TaskPriority::MEDIUM ); pIdle->Start(); } diff --git a/vcl/source/app/idle.cxx b/vcl/source/app/idle.cxx index 78c114801868..0eca28c52306 100644 --- a/vcl/source/app/idle.cxx +++ b/vcl/source/app/idle.cxx @@ -42,8 +42,7 @@ void Idle::Start() { switch ( GetPriority() ) { - case TaskPriority::LOW: - case TaskPriority::LOWER: + case TaskPriority::DEFAULT_IDLE: case TaskPriority::LOWEST: nPeriod = Scheduler::InfiniteTimeoutMs; break; diff --git a/vcl/source/app/scheduler.cxx b/vcl/source/app/scheduler.cxx index 8e5031a3e527..a1634f73e2f3 100644 --- a/vcl/source/app/scheduler.cxx +++ b/vcl/source/app/scheduler.cxx @@ -429,7 +429,7 @@ Task& Task::operator=( const Task& rTask ) Task::Task( const sal_Char *pDebugName ) : mpSchedulerData( nullptr ) , mpDebugName( pDebugName ) - , mePriority( TaskPriority::HIGH ) + , mePriority( TaskPriority::DEFAULT ) , mbActive( false ) { } diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index e2732369bc42..b06b014ce5cd 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -452,7 +452,7 @@ void Application::Execute() pSVData->maAppData.mnEventTestLimit = 50; pSVData->maAppData.mpEventTestingIdle = new Idle("eventtesting"); pSVData->maAppData.mpEventTestingIdle->SetInvokeHandler(LINK(&(pSVData->maAppData), ImplSVAppData, VclEventTestingHdl)); - pSVData->maAppData.mpEventTestingIdle->SetPriority(TaskPriority::MEDIUM); + pSVData->maAppData.mpEventTestingIdle->SetPriority(TaskPriority::HIGH_IDLE); pSVData->maAppData.mpEventTestInput = new SvFileStream("eventtesting", StreamMode::READ); pSVData->maAppData.mpEventTestingIdle->Start(); } diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx index 6cba9e2f2b2f..f615c9f732e6 100644 --- a/vcl/source/app/timer.cxx +++ b/vcl/source/app/timer.cxx @@ -42,7 +42,7 @@ Timer::Timer( bool bAuto, const sal_Char *pDebugName ) , mnTimeout( Scheduler::ImmediateTimeoutMs ) , mbAuto( bAuto ) { - SetPriority( TaskPriority::HIGHEST ); + SetPriority( TaskPriority::DEFAULT ); } Timer::Timer( const sal_Char *pDebugName ) diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx index 9561370aaed9..964f340bc49e 100644 --- a/vcl/source/edit/textdata.cxx +++ b/vcl/source/edit/textdata.cxx @@ -276,7 +276,7 @@ IdleFormatter::IdleFormatter() { mpView = nullptr; mnRestarts = 0; - SetPriority(TaskPriority::HIGH); + SetPriority(TaskPriority::HIGH_IDLE); } IdleFormatter::~IdleFormatter() diff --git a/vcl/source/uitest/uno/uiobject_uno.cxx b/vcl/source/uitest/uno/uiobject_uno.cxx index 317a06db6360..108a215ef326 100644 --- a/vcl/source/uitest/uno/uiobject_uno.cxx +++ b/vcl/source/uitest/uno/uiobject_uno.cxx @@ -119,7 +119,7 @@ void SAL_CALL UIObjectUnoObj::executeAction(const OUString& rAction, const css:: mReady = false; auto aIdle = o3tl::make_unique<Idle>(); aIdle->SetDebugName("UI Test Idle Handler"); - aIdle->SetPriority(TaskPriority::HIGH); + aIdle->SetPriority(TaskPriority::DEFAULT); std::function<void()> func = [this](){ diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index a0621c405345..a26a48507b6e 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -87,11 +87,11 @@ ImplDockFloatWin2::ImplDockFloatWin2( vcl::Window* pParent, WinBits nWinBits, SetBackground( GetSettings().GetStyleSettings().GetFaceColor() ); maDockIdle.SetInvokeHandler( LINK( this, ImplDockFloatWin2, DockTimerHdl ) ); - maDockIdle.SetPriority( TaskPriority::MEDIUM ); + maDockIdle.SetPriority( TaskPriority::HIGH_IDLE ); maDockIdle.SetDebugName( "vcl::ImplDockFloatWin2 maDockIdle" ); maEndDockIdle.SetInvokeHandler( LINK( this, ImplDockFloatWin2, EndDockTimerHdl ) ); - maEndDockIdle.SetPriority( TaskPriority::MEDIUM ); + maDockIdle.SetPriority( TaskPriority::HIGH_IDLE ); maEndDockIdle.SetDebugName( "vcl::ImplDockFloatWin2 maEndDockIdle" ); } diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 4c2dda5b79e5..e96c3de183e9 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -97,7 +97,7 @@ ImplDockFloatWin::ImplDockFloatWin( vcl::Window* pParent, WinBits nWinBits, SetBackground(); maDockIdle.SetInvokeHandler( LINK( this, ImplDockFloatWin, DockTimerHdl ) ); - maDockIdle.SetPriority( TaskPriority::MEDIUM ); + maDockIdle.SetPriority( TaskPriority::HIGH_IDLE ); maDockIdle.SetDebugName( "vcl::ImplDockFloatWin maDockIdle" ); } |