summaryrefslogtreecommitdiff
path: root/src/location
diff options
context:
space:
mode:
authorIan Chen <ian.1.chen@nokia.com>2012-03-29 15:37:48 +1000
committerQt by Nokia <qt-info@nokia.com>2012-03-29 09:07:02 +0200
commit151816a6c2aede2c43a135a42a6b93528c43994a (patch)
treeb8b4da0507491b9986857328e17377b6803beba9 /src/location
parent04921a0ff8c3a6878a77eb6e119ba6a870b2798a (diff)
downloadqtlocation-151816a6c2aede2c43a135a42a6b93528c43994a.tar.gz
Add checking of texture binding status in map geom.
Textures previously bound to GPU (through QGLTexture2d:::bind()) should not have to be bound again. Change-Id: I82a18abbc2c659a3c361af9925fb32abbe6a0026 Reviewed-by: Alex Wilson <alex.wilson@nokia.com>
Diffstat (limited to 'src/location')
-rw-r--r--src/location/maps/qgeomapgeometry.cpp7
-rw-r--r--src/location/maps/qgeotilecache.cpp5
-rw-r--r--src/location/maps/qgeotilecache_p.h3
3 files changed, 13 insertions, 2 deletions
diff --git a/src/location/maps/qgeomapgeometry.cpp b/src/location/maps/qgeomapgeometry.cpp
index a0585b03..663fe2d9 100644
--- a/src/location/maps/qgeomapgeometry.cpp
+++ b/src/location/maps/qgeomapgeometry.cpp
@@ -686,8 +686,11 @@ void QGeoMapGeometryPrivate::paintGL(QGLPainter *painter)
// do any pending upload/releases
while (!newUploads_.isEmpty()) {
- newUploads_.front()->texture->bind();
- newUploads_.front()->texture->clearImage();
+ if (!newUploads_.front()->textureBound){
+ newUploads_.front()->texture->bind();
+ newUploads_.front()->texture->clearImage();
+ newUploads_.front()->textureBound = true;
+ }
newUploads_.pop_front();
}
diff --git a/src/location/maps/qgeotilecache.cpp b/src/location/maps/qgeotilecache.cpp
index 422fa40b..c11397f8 100644
--- a/src/location/maps/qgeotilecache.cpp
+++ b/src/location/maps/qgeotilecache.cpp
@@ -71,6 +71,11 @@ public:
QString format;
};
+QGeoTileTexture::QGeoTileTexture()
+ : texture(0),
+ cache(0),
+ textureBound(false) {}
+
void QCache3QTileEvictionPolicy::aboutToBeRemoved(const QGeoTileSpec &key, QSharedPointer<QGeoCachedTileDisk> obj)
{
Q_UNUSED(key);
diff --git a/src/location/maps/qgeotilecache_p.h b/src/location/maps/qgeotilecache_p.h
index 58ef18c0..c24c3cc6 100644
--- a/src/location/maps/qgeotilecache_p.h
+++ b/src/location/maps/qgeotilecache_p.h
@@ -92,11 +92,14 @@ public:
/* This is also used in the mapgeometry */
class QGeoTileTexture {
public:
+
+ QGeoTileTexture();
~QGeoTileTexture();
QGeoTileSpec spec;
QGLTexture2D *texture;
QGeoTileCache *cache;
+ bool textureBound;
};
/* Custom eviction policy for the disk cache, to avoid deleting all the files