summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2017-11-13 11:53:00 -0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-11-13 11:53:00 -0200
commit82812ea533ad57ace2eb49edecffd88be5d97614 (patch)
tree1bfc0e8b86a24f013d3ba4b29a72cc43d765ea8b
parent1adc585c61e1e42f28c7944816010446091fa161 (diff)
downloadqtlocation-mapboxgl-82812ea533ad57ace2eb49edecffd88be5d97614.tar.gz
Bump Mapbox GL Native
mapbox-gl-native @ 10a9b25928bd8cd28f0c459de1f083e206e473e5
-rw-r--r--platform/qt/src/qmapboxgl.cpp5
-rw-r--r--platform/qt/src/qt_image.cpp5
2 files changed, 10 insertions, 0 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index fc281fdf1d..c9f85adf4c 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -111,8 +111,13 @@ std::unique_ptr<mbgl::style::Image> toStyleImage(const QString &id, const QImage
.rgbSwapped()
.convertToFormat(QImage::Format_ARGB32_Premultiplied);
+#if QT_VERSION >= 0x051000
+ auto img = std::make_unique<uint8_t[]>(swapped.sizeInBytes());
+ memcpy(img.get(), swapped.constBits(), swapped.sizeInBytes());
+#else
auto img = std::make_unique<uint8_t[]>(swapped.byteCount());
memcpy(img.get(), swapped.constBits(), swapped.byteCount());
+#endif
return std::make_unique<mbgl::style::Image>(
id.toStdString(),
diff --git a/platform/qt/src/qt_image.cpp b/platform/qt/src/qt_image.cpp
index 403ca9cbd3..a5c92514c1 100644
--- a/platform/qt/src/qt_image.cpp
+++ b/platform/qt/src/qt_image.cpp
@@ -54,8 +54,13 @@ PremultipliedImage decodeImage(const std::string& string) {
throw std::runtime_error("Unsupported image type");
}
+#if QT_VERSION >= 0x051000
+ auto img = std::make_unique<uint8_t[]>(image.sizeInBytes());
+ memcpy(img.get(), image.constBits(), image.sizeInBytes());
+#else
auto img = std::make_unique<uint8_t[]>(image.byteCount());
memcpy(img.get(), image.constBits(), image.byteCount());
+#endif
return { { static_cast<uint32_t>(image.width()), static_cast<uint32_t>(image.height()) },
std::move(img) };