diff options
author | Paolo Angelelli <paolo.angelelli@theqtcompany.com> | 2016-08-15 12:12:25 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@theqtcompany.com> | 2016-08-30 11:01:14 +0000 |
commit | 52c8bfa6be4fc6c47f99c9f37c142554932c7228 (patch) | |
tree | d70ffc9c7bc690c980a05e1c1d950d06b1db6919 /src/location/maps/qgeotiledmapscene.cpp | |
parent | 832030f271105a96bdde70b0526df659f21de565 (diff) | |
download | qtlocation-52c8bfa6be4fc6c47f99c9f37c142554932c7228.tar.gz |
Add OSM plugin parameter osm.mapping.highdpi_tiles
This patch adds a mean to enable/disable high dpi support for the
OSM plugin too, following the same approach taken for the mapbox and
here plugins.
In order to do so, it has been necessary to rework QGeoTileProviderOsm.
It can now be constructed with an arbitrary number of TileProviders,
as opposed to the previous approach with one primary and one fallback
tileprovider.
It has also been necessary to disable Nearest interpolation for high
dpi tiles, as it appears to produce considerable artifacts.
So in presence of highdpi tiles, Linear interpolation is now always
used.
Change-Id: Id7d20fd5a320f3d5ef41b9fa28447a5c4f5398be
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/maps/qgeotiledmapscene.cpp')
-rw-r--r-- | src/location/maps/qgeotiledmapscene.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/location/maps/qgeotiledmapscene.cpp b/src/location/maps/qgeotiledmapscene.cpp index 33c0bb8c..3896a51e 100644 --- a/src/location/maps/qgeotiledmapscene.cpp +++ b/src/location/maps/qgeotiledmapscene.cpp @@ -661,9 +661,12 @@ void QGeoTiledMapRootNode::updateTiles(QGeoTiledMapTileContainerNode *root, delete node; } else { if (isTextureLinear != d->m_linearScaling) { - node->setFiltering(d->m_linearScaling ? QSGTexture::Linear : QSGTexture::Nearest); - if (node->texture()->textureSize().width() > d->m_tileSize) + if (node->texture()->textureSize().width() > d->m_tileSize) { + node->setFiltering(QSGTexture::Linear); // With mipmapping QSGTexture::Nearest generates artifacts node->setMipmapFiltering(QSGTexture::Linear); + } else { + node->setFiltering(d->m_linearScaling ? QSGTexture::Linear : QSGTexture::Nearest); + } dirtyBits |= QSGNode::DirtyMaterial; } if (dirtyBits != 0) @@ -680,9 +683,12 @@ void QGeoTiledMapRootNode::updateTiles(QGeoTiledMapTileContainerNode *root, // note: setTexture will update coordinates so do it here, before we buildGeometry tileNode->setTexture(textures.value(s)); if (d->buildGeometry(s, tileNode) && qgeotiledmapscene_isTileInViewport(tileNode->rect(), root->matrix())) { - tileNode->setFiltering(d->m_linearScaling ? QSGTexture::Linear : QSGTexture::Nearest); - if (tileNode->texture()->textureSize().width() > d->m_tileSize) + if (tileNode->texture()->textureSize().width() > d->m_tileSize) { + tileNode->setFiltering(QSGTexture::Linear); // with mipmapping QSGTexture::Nearest generates artifacts tileNode->setMipmapFiltering(QSGTexture::Linear); + } else { + tileNode->setFiltering(d->m_linearScaling ? QSGTexture::Linear : QSGTexture::Nearest); + } root->addChild(s, tileNode); } else { delete tileNode; |