Use swap events to drive repaints

Review Request #121590 - Created Dec. 18, 2014 and updated - Latest diff uploaded

Information
Fredrik Höglund
kwin
master
Reviewers
kwin

Don't start the composite timer at the end of performPaint() when a
buffer swap is pending and vsync is enabled. Instead set
m_composeAtSwapCompletion to true so performPaint() gets called again
as soon as the swap completes.

This makes the repaint cycle look like this:

scene->paint()
SwapBuffers()
Process events
      ·
      ·
Swap completes
Fetch and reset damage (if applicable)
scene->paint()
SwapBuffers()
Process events
      ·
      ·
Swap completes
...

This results in a noticeable improvement in animation smoothness with
drivers that support GLX_INTEL_swap_event, since we're now able to
consistently render at the monitor refresh rate.


  
Loading...