summaryrefslogtreecommitdiff
path: root/platform/qt
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-04-21 14:52:19 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-04-24 15:52:28 -0700
commit5dd98df50ba1210b1eef0d8d6655713a725f2995 (patch)
treeb289bb3cbad5d1c3076816f4891a057d6089fc93 /platform/qt
parent6f708ac5458fe332e25ca398431928b7ff5ba404 (diff)
downloadqtlocation-mapboxgl-5dd98df50ba1210b1eef0d8d6655713a725f2995.tar.gz
[all] Rationalize style::Image
A style has a collection of images, just as it has collections of sources and layers. * Name things appropriately * Use std::unique_ptr
Diffstat (limited to 'platform/qt')
-rw-r--r--platform/qt/src/qmapboxgl.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index fa4f56373c..dedff24c54 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -15,7 +15,7 @@
#include <mbgl/style/layers/custom_layer.hpp>
#include <mbgl/style/sources/geojson_source.hpp>
#include <mbgl/style/transition_options.hpp>
-#include <mbgl/sprite/sprite_image.hpp>
+#include <mbgl/style/image.hpp>
#include <mbgl/storage/network_status.hpp>
#include <mbgl/util/color.hpp>
#include <mbgl/util/constants.hpp>
@@ -88,7 +88,7 @@ mbgl::Size sanitizedSize(const QSize& size) {
};
};
-std::unique_ptr<const mbgl::SpriteImage> toSpriteImage(const QImage &sprite) {
+std::unique_ptr<mbgl::style::Image> toStyleImage(const QImage &sprite) {
const QImage swapped = sprite
.rgbSwapped()
.convertToFormat(QImage::Format_ARGB32_Premultiplied);
@@ -96,7 +96,7 @@ 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>(
+ return std::make_unique<mbgl::style::Image>(
mbgl::PremultipliedImage(
{ static_cast<uint32_t>(swapped.width()), static_cast<uint32_t>(swapped.height()) },
std::move(img)),
@@ -1114,7 +1114,7 @@ void QMapboxGL::addAnnotationIcon(const QString &name, const QImage &icon)
{
if (icon.isNull()) return;
- d_ptr->mapObj->addAnnotationIcon(name.toStdString(), toSpriteImage(icon));
+ d_ptr->mapObj->addAnnotationImage(name.toStdString(), toStyleImage(icon));
}
/*!
@@ -1414,7 +1414,7 @@ void QMapboxGL::addImage(const QString &id, const QImage &image)
{
if (image.isNull()) return;
- d_ptr->mapObj->addImage(id.toStdString(), toSpriteImage(image));
+ d_ptr->mapObj->addImage(id.toStdString(), toStyleImage(image));
}
/*!