diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-04-05 10:44:16 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2019-04-08 16:19:57 +0200 |
commit | 62b309e5cf24570a242dbf41c53ece60b23292eb (patch) | |
tree | 9839de5517d4ca3c1e821b0daba1b29e00d8596a | |
parent | 5bff92cfcb9cf97c742cc9fb4d85b79b082b941e (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.
(cherry picked from commit 3e0092031b73bad107e3122d5d4be2f5bd487744)
Change-Id: I25b2dc0aa41af62d9bd89617178eb2e9997f5b17
Reviewed-on: https://gerrit.libreoffice.org/70295
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-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 b58f4b486247..f8b049c28b35 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -64,6 +64,7 @@ #include <vcl/canvastools.hxx> #include <vcl/commandinfoprovider.hxx> #include <vcl/settings.hxx> +#include <vcl/scheduler.hxx> #include <comphelper/anytostring.hxx> #include <cppuhelper/exc_hlp.hxx> @@ -1670,7 +1671,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 |