From 979a0406f0013560efbdcc486b32ba93ce8c946f Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 13 Mar 2014 11:38:27 +0100 Subject: Replace Qt3D with scene graph API for map rendering. QtLocation now links against QtQuick and the QGeoMap has a updateSceneGraph(QSGNode *, QQuickWindow *) function to populate the scene graph with map content in what ever style the implementation decides. The only implementation right now is the QGeoTileMapData (same as with the Qt3D code). Camera positioning, zooming, panning, etc has been preserved in the interest of minimzing the change and keeping things "as they were". All rendering logic is moved into the updateSceneGraph function, where we find the delta between what is shown in the scene graph and what the scene things should be visible. Nodes are added removed accordingly. This logic is isolated from the rest of the code as it primarily lives in the scene graph render thread and may be released at an arbitrary time. Doing this every frame might seem daunting, but for the most, it is a couple of checks on a few tens of nodes, compared to rendering millions of pixels afterwards, so this is not going to be a bottleneck. Texture uploads are now done in the scene graph's rendering phase, so the map item's sync is fast. This means the map element doesn't block both GUI and render threads for extended time periods. In contrast, the Qt3D code path uploaded tiles and rendered them to an FBO in the sync phase, resulting in very poor parallelization. We cache the textures designated as visible and nothing else. Primarily in the interest of simplicity, but also because uploading 256x256 textures is a no-brainer on modern GPU's, including lower-end mobile and embedded. The QGeoTileTexture sits on a QImage instead of an actual texture to keep a strict separation between render thread and GUI thread clean. Texture cleanup is done by the scene graph structure. The Qt3D codepath rendered to an FBO, so it was implicitly clipped to its bounds. To preserve this behavior, the scene graph implementation does the same. Not doing so looks a bit odd, at least when zooming all the way out so the world is significantly smaller than the viewport. The scene graph code also adds a rectangle of solid 0.9 gray to match the default color of the old FBO code. Change-Id: Ia736cea6e3616721c2de6beb5d72e570adcb21e6 Reviewed-by: Fabian Bumberger Reviewed-by: Robin Burchell Reviewed-by: Alex Blasche --- tests/auto/qgeocameratiles/qgeocameratiles.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/auto/qgeocameratiles') diff --git a/tests/auto/qgeocameratiles/qgeocameratiles.pro b/tests/auto/qgeocameratiles/qgeocameratiles.pro index 1c53e627..0abfa9bf 100644 --- a/tests/auto/qgeocameratiles/qgeocameratiles.pro +++ b/tests/auto/qgeocameratiles/qgeocameratiles.pro @@ -5,5 +5,5 @@ INCLUDEPATH += ../../../src/location/maps SOURCES += tst_qgeocameratiles.cpp -QT += location positioning-private testlib 3d +QT += location positioning-private testlib DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0 -- cgit v1.2.1