diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-04-05 10:44:16 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-04-05 11:32:56 +0200 |
commit | 3e0092031b73bad107e3122d5d4be2f5bd487744 (patch) | |
tree | f4648052bae449958e89b159c72c7b4280ee4293 /sd/source/ui/slideshow/slideshowimpl.cxx | |
parent | 01757656f2cc36b6cb8be88ebc0ea1050e0e5c39 (diff) |
tdf#112318 sd opengl: fix lack of initial animation
Commit 881043d1f01fad663c0a17f11cbe2dab79e31217 (#i98792# Allow frequent
calls to slide show update()., 2009-04-27) added a comment in
sd::SlideshowImpl::updateSlideShow() talking about an "above" case, when
the slideshow update suggests to not wait till the next update,
but later commit 12dcf5e6e770b1933252a1f919663ba45ded4cdf (slideshow:
cleanup main-loop usage, post-yield listeners, etc., 2015-11-13) removed
that handling.
That was fine till opengl rendering was introduced, which swaps its
backbuffer in an idle handler. Given that OpenGLFlushIdle's priority is
TaskPriority::POST_PAINT and SlideshowImpl::maUpdateTimer's priority is
TaskPriority::REPAINT, the GL backbuffer is not always painted while an
animation is ongoing.
This is more visible when tweaking the bugdoc to have an e.g. 5 sec
animation, then starting the slideshow results in waiting for 5 seconds
and only then the slide shows up, without an animation.
Fix the problem by re-introducing the handling of the fUpdate == 0, and
processing idle events there, which means the GL backbuffer will be
always painted, regardless if fUpdate is a small number or 0.
Change-Id: I25b2dc0aa41af62d9bd89617178eb2e9997f5b17
Reviewed-on: https://gerrit.libreoffice.org/70287
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sd/source/ui/slideshow/slideshowimpl.cxx')
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 83d594415b2d..2cbc9e0a67d1 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -74,6 +74,7 @@ #include <vcl/canvastools.hxx> #include <vcl/commandinfoprovider.hxx> #include <vcl/settings.hxx> +#include <vcl/scheduler.hxx> #include <comphelper/anytostring.hxx> #include <comphelper/processfactory.hxx> @@ -1695,7 +1696,12 @@ void SlideshowImpl::updateSlideShow() if (mxShow.is() && (fUpdate >= 0.0)) { - if (!::basegfx::fTools::equalZero(fUpdate)) + if (::basegfx::fTools::equalZero(fUpdate)) + { + // Make sure idle tasks don't starve when we don't have to wait. + Scheduler::ProcessEventsToIdle(); + } + else { // Avoid busy loop when the previous call to update() // returns a small positive number but not 0 (which is |