Implemented multiple windows and GL context sharing
authorGunnar Sletta <gunnar.sletta@nokia.com>
Wed, 7 Dec 2011 09:16:20 +0000 (10:16 +0100)
committerQt by Nokia <qt-info@nokia.com>
Thu, 8 Dec 2011 09:10:27 +0000 (10:10 +0100)
commitfdd14a1a10a0a2f42015b30071771bd95215cc1a
tree1e79b74017df70e7f4b034dd4460406041507636
parent9128eb13040c57872e226222c9a45cad9946ed1a
Implemented multiple windows and GL context sharing

What was traditionally the QQuickRenderLoop which was used
to support one QQuickCanvas instance has now grown to support
multiple QQuickCanvas instances and is now called
QQuickWindowManager, of which there are two implementations.

QQuickRenderThreadSingleContextWindowManager:
One QSGContext and one OpenGL context is being used to draw
all the windows and we alternate between which surface the gl
context is bound to. This implementation relies on that
swap does not block, but that the graphics pipeline is
vsynced and will eventually block as the buffer queue is
filled up. This is the behavior we get on Mac OS X and
Wayland. The benefit of this implementation is that we have
vsync'ed animations, and the synchronizaiton between GUI and
render thread is simple. (well, simple relative to the
alternative, that is).

QQuickTrivialWindowManager:
One QSGContext and one OpenGL context is being used on the GUI
thread. Animations are ticked from a timer. Performance of this
implementation will deteriorate if the driver is using blocking
swap.

Task-number: QTBUG-19455
Change-Id: Ib961ac7d71eb49c70a057872b7cac020c4d19f3d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
12 files changed:
src/quick/items/items.pri
src/quick/items/qquickcanvas.cpp
src/quick/items/qquickcanvas.h
src/quick/items/qquickcanvas_p.h
src/quick/items/qquickwindowmanager.cpp [new file with mode: 0644]
src/quick/items/qquickwindowmanager_p.h [new file with mode: 0644]
src/quick/scenegraph/qsgcontext.cpp
src/quick/scenegraph/qsgcontext_p.h
tests/auto/qtquick2/qquickcanvas/data/AnimationsWhileHidden.qml [new file with mode: 0644]
tests/auto/qtquick2/qquickcanvas/qquickcanvas.pro
tests/auto/qtquick2/qquickcanvas/tst_qquickcanvas.cpp
tools/qmlscene/main.cpp