summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2017-03-24 14:00:59 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2017-03-27 10:39:32 +0000
commitbd63a1c5144945c134674e2b253afe26673ca13f (patch)
tree15d1cc7d3bb3578d52613ee66902d7a581dfe05a
parent4f03448a9ef95dd5a20b1fa4af31a5865413e5f4 (diff)
downloadqtlocation-bd63a1c5144945c134674e2b253afe26673ca13f.tar.gz
Proactively convert tile formats to ARGB32_Premultiplied
This patch avoids each bind to do this conversion if the format of the tile isn't RGB or ARGB32_Premultiplied. This is the case of PNG with alpha channel, that usually comes as ARGB32. Change-Id: I8f1297dd82ab20b6c8ecac3e68bf5d82e03f2e70 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/location/maps/qgeofiletilecache.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/location/maps/qgeofiletilecache.cpp b/src/location/maps/qgeofiletilecache.cpp
index f080c7f9..a583e66a 100644
--- a/src/location/maps/qgeofiletilecache.cpp
+++ b/src/location/maps/qgeofiletilecache.cpp
@@ -490,6 +490,10 @@ QSharedPointer<QGeoTileTexture> QGeoFileTileCache::getFromDisk(const QGeoTileSpe
return QSharedPointer<QGeoTileTexture>(0);
}
+ // Converting it here, instead of in each QSGTexture::bind()
+ if (image.format() != QImage::Format_RGB32 && image.format() != QImage::Format_ARGB32_Premultiplied)
+ image = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+
addToMemoryCache(spec, bytes, format);
QSharedPointer<QGeoTileTexture> tt = addToTextureCache(td->spec, image);
if (tt)