summaryrefslogtreecommitdiff
path: root/platform/qt
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-08-22 17:57:22 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-09-27 10:42:10 +0200
commit63e53de157e75e504a6bf1a678cebaea5acf72b9 (patch)
tree234cb14695f21df69012f1470ee512b8fc8d9904 /platform/qt
parent512037cfdc14fb1f7686254efe97b72433c5e4b6 (diff)
downloadqtlocation-mapboxgl-63e53de157e75e504a6bf1a678cebaea5acf72b9.tar.gz
[core] standardize on uint16_t for texture sizes
Diffstat (limited to 'platform/qt')
-rw-r--r--platform/qt/src/image.cpp4
-rw-r--r--platform/qt/src/qmapboxgl.cpp8
2 files changed, 7 insertions, 5 deletions
diff --git a/platform/qt/src/image.cpp b/platform/qt/src/image.cpp
index f51f993d48..3918b35208 100644
--- a/platform/qt/src/image.cpp
+++ b/platform/qt/src/image.cpp
@@ -57,7 +57,7 @@ PremultipliedImage decodeImage(const std::string& string) {
auto img = std::make_unique<uint8_t[]>(image.byteCount());
memcpy(img.get(), image.constBits(), image.byteCount());
- return { size_t(image.width()), size_t(image.height()), std::move(img) };
+ return { static_cast<uint16_t>(image.width()), static_cast<uint16_t>(image.height()),
+ std::move(img) };
}
-
}
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index 8a6be68c63..74238bd240 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -119,11 +119,13 @@ std::unique_ptr<const mbgl::SpriteImage> toSpriteImage(const QImage &sprite) {
auto img = std::make_unique<uint8_t[]>(swapped.byteCount());
memcpy(img.get(), swapped.constBits(), swapped.byteCount());
- return std::make_unique<mbgl::SpriteImage>(mbgl::PremultipliedImage
- { size_t(swapped.width()), size_t(swapped.height()), std::move(img) }, 1.0);
+ return std::make_unique<mbgl::SpriteImage>(
+ mbgl::PremultipliedImage{ static_cast<uint16_t>(swapped.width()),
+ static_cast<uint16_t>(swapped.height()), std::move(img) },
+ 1.0);
}
-}
+} // namespace
/*!
\class QMapboxGLSettings