diff options
author | Fabian Bumberger <fbumberger@rim.com> | 2013-11-21 08:26:47 +0100 |
---|---|---|
committer | Fabian Bumberger <fbumberger@rim.com> | 2014-01-28 16:57:25 +0100 |
commit | 3a4e145e5eb7a21cf4432bf64940306954921026 (patch) | |
tree | fee23be10c6800aaf0df137c7e964f09accc324a /src/location/maps/qgeomapscene_sg.cpp | |
parent | 40523fde410adf74d021bec4869e9bf6a7aef39c (diff) |
Implement textures ansd geometry creation for the SG renderer
Change-Id: Ia91e8b7220c333b9fa6d718eec4a950f3f1fc583
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
Diffstat (limited to 'src/location/maps/qgeomapscene_sg.cpp')
-rw-r--r-- | src/location/maps/qgeomapscene_sg.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/location/maps/qgeomapscene_sg.cpp b/src/location/maps/qgeomapscene_sg.cpp index 1b0b5a35..33072bd5 100644 --- a/src/location/maps/qgeomapscene_sg.cpp +++ b/src/location/maps/qgeomapscene_sg.cpp @@ -41,6 +41,11 @@ #include "qgeomapscene_p_p.h" +#include "qgeotilespec_p.h" +#include "qgeotilecache_p.h" + +#include <QSGSimpleTextureNode> + QT_BEGIN_NAMESPACE @@ -54,6 +59,27 @@ void QGeoMapScenePrivate::setScalingOnTextures() void QGeoMapScenePrivate::addTile(const QGeoTileSpec &spec, QSharedPointer<QGeoTileTexture> texture) { + if (!visibleTiles_.contains(spec)) // Don't add the geometry if it isn't visible + return; + + const QRectF &rect = buildGeometry(spec); + if (rect.isNull()) + return; + + QSGSimpleTextureNode *node = new QSGSimpleTextureNode(); + + if (linearScaling_) { + node->setFiltering(QSGTexture::Linear); + } else { + node->setFiltering(QSGTexture::Nearest); + } + + node->setRect(rect); + node->setTexture(texture->texture); + + nodes_.insert(spec, node); + textures_.insert(spec, texture); + newUploads_ << texture; } // return true if new tiles introduced in [tiles] |