diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-11-13 09:56:53 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2015-11-13 14:03:31 +0000 |
commit | 12dcf5e6e770b1933252a1f919663ba45ded4cdf (patch) | |
tree | 2b084a51384735ec383cf52d7c6d72a13ac90eff /vcl/source | |
parent | ea6857f86b444fe7f87e74c41dbfe9ba8c02f942 (diff) |
slideshow: cleanup main-loop usage, post-yield listeners, etc.
This removes several attempts at reducing jitter in slideshow
animations. Now we have high-resolution (ie. not clamped to 10ms)
timers on Windows and a cleaner and simpler main-loop, we should
be able to use generic timer code-paths for all of this.
This also allows us to further cleanup and simplify the main-loop
removing the now redundent post-yield handler concept. If there is a
short enough timeout, we will take just 1ms of delay before executing
a short timer anyway.
Also removed some lingering comments from an old attempt to boost
priorities which broken audio playback.
Tested: tdf#32861 - still works, audio still plays, no new jitter
in animations that I tested.
Change-Id: Iadc5e2a48828a18a599a86a8df14cb2b75dd425e
Reviewed-on: https://gerrit.libreoffice.org/19947
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/svapp.cxx | 60 | ||||
-rw-r--r-- | vcl/source/app/svmain.cxx | 5 |
2 files changed, 1 insertions, 64 deletions
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index b57b45e7f3b8..09bbf2d5f25c 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -492,7 +492,7 @@ inline void ImplYield(bool i_bWait, bool i_bAllEvents, sal_uLong const nReleased // do not wait for events either if the app decided that it is too busy for timers // (feature added for the slideshow) pSVData->mpDefInst->DoYield( - i_bWait && !pSVData->maAppData.mbAppQuit && !pSVData->maAppData.mbNoYield, + i_bWait && !pSVData->maAppData.mbAppQuit, i_bAllEvents, nReleased); pSVData->maAppData.mnDispatchLevel--; @@ -501,31 +501,6 @@ inline void ImplYield(bool i_bWait, bool i_bAllEvents, sal_uLong const nReleased // flush lazy deleted objects if( pSVData->maAppData.mnDispatchLevel == 0 ) vcl::LazyDelete::flush(); - - // the system timer events will not necessarily come in non waiting mode - // e.g. on OS X; need to trigger timer checks manually - if( pSVData->maAppData.mbNoYield ) - { - //Process all timers - Scheduler::ProcessTaskScheduling(true); - } - - // call post yield listeners - if( pSVData->maAppData.mpPostYieldListeners ) - { - vcl::DeletionListener aDel( pSVData->maAppData.mpPostYieldListeners ); - - auto& rYieldListeners = pSVData->maAppData.mpPostYieldListeners->m_aListeners; - // Copy the list, because this can be destroyed when calling a Link... - std::vector<Link<LinkParamNone*,void>> aCopy( rYieldListeners ); - for( Link<LinkParamNone*,void>& rLink : aCopy ) - { - if (aDel.isDeleted()) break; - // check this hasn't been removed in some re-enterancy scenario fdo#47368 - if( std::find(rYieldListeners.begin(), rYieldListeners.end(), rLink) != rYieldListeners.end() ) - rLink.Call( nullptr ); - } - } } void Application::Reschedule( bool i_bAllEvents ) @@ -1096,39 +1071,6 @@ void Application::RemoveIdleHdl( const Link<Application*,void>& rLink ) pSVData->maAppData.mpIdleMgr->RemoveIdleHdl( rLink ); } -void Application::EnableNoYieldMode() -{ - ImplSVData* pSVData = ImplGetSVData(); - pSVData->maAppData.mbNoYield = true; -} - -void Application::DisableNoYieldMode() -{ - ImplSVData* pSVData = ImplGetSVData(); - pSVData->maAppData.mbNoYield = false; -} - -void Application::AddPostYieldListener( const Link<LinkParamNone*,void>& i_rListener ) -{ - ImplSVData* pSVData = ImplGetSVData(); - if( ! pSVData->maAppData.mpPostYieldListeners ) - pSVData->maAppData.mpPostYieldListeners = new SVAppPostYieldListeners(); - // ensure uniqueness - auto& rYieldListeners = pSVData->maAppData.mpPostYieldListeners->m_aListeners; - if (std::find(rYieldListeners.begin(), rYieldListeners.end(), i_rListener) == rYieldListeners.end()) - rYieldListeners.push_back( i_rListener ); -} - -void Application::RemovePostYieldListener( const Link<LinkParamNone*,void>& i_rListener ) -{ - ImplSVData* pSVData = ImplGetSVData(); - if( pSVData->maAppData.mpPostYieldListeners ) - { - auto& rYieldListeners = pSVData->maAppData.mpPostYieldListeners->m_aListeners; - rYieldListeners.erase( std::remove(rYieldListeners.begin(), rYieldListeners.end(), i_rListener ), rYieldListeners.end() ); - } -} - WorkWindow* Application::GetAppWindow() { return ImplGetSVData()->maWinData.mpAppWin; diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index ca2ae8245436..06f08114ee7d 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -508,11 +508,6 @@ void DeInitVCL() delete pSVData->maAppData.mpKeyListeners; pSVData->maAppData.mpKeyListeners = nullptr; } - if ( pSVData->maAppData.mpPostYieldListeners ) - { - delete pSVData->maAppData.mpPostYieldListeners; - pSVData->maAppData.mpPostYieldListeners = nullptr; - } if ( pSVData->maAppData.mpFirstHotKey ) ImplFreeHotKeyData(); |