summaryrefslogtreecommitdiffstats
path: root/src/location/maps/qgeotiledmapscene.cpp
diff options
context:
space:
mode:
authorLauri Laanmets <lauri.laanmets@eesti.ee>2021-09-30 17:08:16 +0300
committerLauri Laanmets <lauri.laanmets@eesti.ee>2022-02-28 17:11:26 +0200
commita068ca3003bd6b0c8312e6d79857549ead6bc6f6 (patch)
tree0680635a97ea70a11db9f3599657d9ede771a4fd /src/location/maps/qgeotiledmapscene.cpp
parentba0fae5c91dd4c1b5ae2db819df4a69efd853d44 (diff)
Port OpenGL dependent code to Qt6 updated graphics API
All 'old' map object ported to new Qt6 API and tested (almost). Labs project is not tested. This is part of a bigger work to port QtLocation maps to Qt6. Task-number: QTBUG-96795 Change-Id: I0b748a7f4c37f4fcc0cad038e2846b7c86dec84e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Diffstat (limited to 'src/location/maps/qgeotiledmapscene.cpp')
-rw-r--r--src/location/maps/qgeotiledmapscene.cpp20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/location/maps/qgeotiledmapscene.cpp b/src/location/maps/qgeotiledmapscene.cpp
index 622646f1..72c32cb8 100644
--- a/src/location/maps/qgeotiledmapscene.cpp
+++ b/src/location/maps/qgeotiledmapscene.cpp
@@ -486,8 +486,7 @@ static bool qgeotiledmapscene_isTileInViewport(const QRectF &tileRect, const QMa
void QGeoTiledMapRootNode::updateTiles(QGeoTiledMapTileContainerNode *root,
QGeoTiledMapScenePrivate *d,
double camAdjust,
- QQuickWindow *window,
- bool ogl)
+ QQuickWindow *window)
{
// Set up the matrix...
QDoubleVector3D eye = d->m_cameraEye;
@@ -534,12 +533,6 @@ void QGeoTiledMapRootNode::updateTiles(QGeoTiledMapTileContainerNode *root,
} else {
node->setFiltering((d->m_linearScaling || overzooming) ? QSGTexture::Linear : QSGTexture::Nearest);
}
-#if QT_CONFIG(opengl)
- if (ogl)
- static_cast<QSGDefaultImageNode *>(node)->setAnisotropyLevel(QSGTexture::Anisotropy16x);
-#else
- Q_UNUSED(ogl);
-#endif
dirtyBits |= QSGNode::DirtyMaterial;
}
if (dirtyBits != 0)
@@ -567,10 +560,6 @@ void QGeoTiledMapRootNode::updateTiles(QGeoTiledMapTileContainerNode *root,
} else {
tileNode->setFiltering((d->m_linearScaling || overzooming) ? QSGTexture::Linear : QSGTexture::Nearest);
}
-#if QT_CONFIG(opengl)
- if (ogl)
- static_cast<QSGDefaultImageNode *>(tileNode)->setAnisotropyLevel(QSGTexture::Anisotropy16x);
-#endif
root->addChild(s, tileNode);
} else {
#ifdef QT_LOCATION_DEBUG
@@ -595,7 +584,6 @@ QSGNode *QGeoTiledMapScene::updateSceneGraph(QSGNode *oldNode, QQuickWindow *win
return 0;
}
- bool isOpenGL = (window->rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL);
QGeoTiledMapRootNode *mapRoot = static_cast<QGeoTiledMapRootNode *>(oldNode);
if (!mapRoot)
mapRoot = new QGeoTiledMapRootNode();
@@ -664,9 +652,9 @@ QSGNode *QGeoTiledMapScene::updateSceneGraph(QSGNode *oldNode, QQuickWindow *win
#ifdef QT_LOCATION_DEBUG
d->m_sideLengthPixel = sideLength;
#endif
- mapRoot->updateTiles(mapRoot->tiles, d, 0, window, isOpenGL);
- mapRoot->updateTiles(mapRoot->wrapLeft, d, +sideLength, window, isOpenGL);
- mapRoot->updateTiles(mapRoot->wrapRight, d, -sideLength, window, isOpenGL);
+ mapRoot->updateTiles(mapRoot->tiles, d, 0, window);
+ mapRoot->updateTiles(mapRoot->wrapLeft, d, +sideLength, window);
+ mapRoot->updateTiles(mapRoot->wrapRight, d, -sideLength, window);
mapRoot->isTextureLinear = d->m_linearScaling;