Renderloop for Windows
authorGunnar Sletta <gunnar.sletta@digia.com>
Tue, 16 Apr 2013 15:25:04 +0000 (17:25 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 24 Apr 2013 15:14:41 +0000 (17:14 +0200)
commit73d8bcda7d1b4317f38d8a2844294601325915aa
tree6e54cecb3be42cf64e129fd6efce0a24cb83fc10
parent9d6b4212b448686f415f3744969e5fb9769f4d98
Renderloop for Windows

The normal GUI thread render loop has several problems on windows.
It does not do vsync animations and on some hardware, where the
vsync delta is higher than the time it takes to fire a 16ms timer,
the eventloop will always contain at least one event and we never
return to processing non-client area events, like resize.

Also, threaded OpenGL seems rather unstable, so the threaded renderer
is not a stable option.

So we introduce a windows based renderloop. It is fully cross platform
but written to make the most out of the limitations which exist.

The overall goal is:
  - vsync animations when allowed by the system. We get this by
    using an animation driver and advancing in sync with rendering
  - Keep system load low and allow for NC processing. The maybeUpdate
    function will start a short timer which will let the renderloop
    idle for few ms, allowing the eventloop to pick up system events.
    (this is similar to what the threaded renderer also does, btw)

Change-Id: Ic192fd0ed7d5ecdaa2c887c08cbeb42c5de6b8a8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
src/quick/scenegraph/qsgrenderloop.cpp
src/quick/scenegraph/qsgwindowsrenderloop.cpp [new file with mode: 0644]
src/quick/scenegraph/qsgwindowsrenderloop_p.h [new file with mode: 0644]
src/quick/scenegraph/scenegraph.pri