summaryrefslogtreecommitdiff
path: root/src/src.pro
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2014-03-13 11:38:27 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-03-24 13:47:05 +0100
commit979a0406f0013560efbdcc486b32ba93ce8c946f (patch)
tree3226cb4c86a868ec8920196436540dc272a20aea /src/src.pro
parentbacc237f032bebe51c436760d31e4a804c3ee034 (diff)
downloadqtlocation-979a0406f0013560efbdcc486b32ba93ce8c946f.tar.gz
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 <fbumberger@rim.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/src.pro')
-rw-r--r--src/src.pro7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/src.pro b/src/src.pro
index 72274cdc..c00a4b8a 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -9,22 +9,19 @@ positioning_doc_snippets.subdir = positioning/doc/snippets
positioning_doc_snippets.depends = positioning
SUBDIRS += positioning_doc_snippets
-#no point in building QtLocation without Qt3D
-qtHaveModule(3d) {
+qtHaveModule(quick) {
SUBDIRS += 3rdparty
location.depends = positioning 3rdparty
SUBDIRS += location
plugins.depends += location
- qtHaveModule(quick):imports.depends += location
+ imports.depends += location
location_doc_snippets.subdir = location/doc/snippets
location_doc_snippets.depends = location
SUBDIRS += location_doc_snippets
-}
-qtHaveModule(quick) {
imports.depends += positioning
SUBDIRS += imports
}