Kaydet (Commit) 3e009203 authored tarafından Miklos Vajna's avatar Miklos Vajna

tdf#112318 sd opengl: fix lack of initial animation

Commit 881043d1 (#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 12dcf5e6 (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/70287Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
üst 01757656
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment