Issue 98792 - Slide show needs idle callback
Summary: Slide show needs idle callback
Alias: None
Product: Impress
Classification: Application
Component: code (show other issues)
Version: DEV300m39
Hardware: All All
: P3 Trivial (vote)
Target Milestone: OOo 3.3
Assignee: groucho266
QA Contact: issues@graphics
Depends on:
Reported: 2009-02-03 14:55 UTC by groucho266
Modified: 2017-05-20 10:29 UTC (History)
1 user (show)

See Also:
Latest Confirmation in: ---
Developer Difficulty: ---


Note You need to log in before you can comment on or make changes to this issue.
Description groucho266 2009-02-03 14:55:01 UTC
When the slide show is running the current event loop does not allow smooth
animation because time between callbacks varies greatly.

For a smooth animation the slide show needs to be called from the main event loop
a) after all due timer events are processed (so that the rest of the application
is not completely blocked)
b) without any further timeout that would add a delay of the size of the minimum
system timeout (something about 10ms on some systems).
Comment 1 philipp.lohmann 2009-02-19 13:49:01 UTC
static void Application::EnableNoYieldMode( bool i_bNoYield );
static void Application::AddPostYieldListener( const Link& i_rListener );
static void Application::RemovePostYieldListener( const Link& i_rListener );

please check if that is useful to you
Comment 2 groucho266 2009-04-27 12:30:39 UTC
The slide show now uses the new vcl feature during animations.  Synchronization
of a steady frame rate (not too fast and not too slow) is done in

Changes in sd have revision 271262.
Changes in slideshow have revision 271263.
Comment 3 groucho266 2009-05-06 13:07:45 UTC
As the above does not seem to be very enlightening I will try to explain what I
am trying to do for this issue.

During animations in the slideshow (ActivitiesQueue is not empty) VCL is put
into a special mode that 
a) processes all due timers and
b) calls the registered (with AddPostYieldListener) listener as often as
possible (no wait or sleep).

This allows the SlideShowImpl::update() method to be called (from SD, triggered
by VCL via the post-yield listener) as often as possible.  Depending on the
hardware this could result in frame rates higher as desired (more than 60 frames
can not be displayed on many monitors).  Therefore the frame rate is reduced to
the desired number by waiting between preparation of the new frame and
displaying it.

The major change made for this issue was to move the code that waits from VCL
(timer based) to the slideshow module.  Furthermore it is done now with a
combination of (wait/sleep, not yet implemented) and busy wait.  This reduces
the error of the duration between frames from the tens of milliseconds down to
sub-millisecond values.

What remains to be done is to render the frame not for the time at which
rendering starts but for the time at which the frame will be displayed.
Comment 4 groucho266 2009-09-14 16:29:27 UTC
Changing target to OOo 3.3
Comment 5 groucho266 2009-10-23 14:31:15 UTC
I can verify PLs changes in VCL.  PL has reviewed my changes in sd.