summaryrefslogtreecommitdiff
path: root/platform/qt
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2017-02-20 14:59:17 +0100
committerKonstantin Käfer <mail@kkaefer.com>2017-02-20 19:26:06 +0100
commit3ef9e26593bfda1f32bc15d29016d9bb83acb67c (patch)
treed153624f97f189527af040f10594f3326e3a1e22 /platform/qt
parent4e752f63b94b71d901a1933a1bb121332fffe96b (diff)
downloadqtlocation-mapboxgl-3ef9e26593bfda1f32bc15d29016d9bb83acb67c.tar.gz
[ios,macos,android,qt] use shared threadpool
Diffstat (limited to 'platform/qt')
-rw-r--r--platform/qt/qt.cmake4
-rw-r--r--platform/qt/src/qmapboxgl.cpp5
-rw-r--r--platform/qt/src/qmapboxgl_p.hpp2
3 files changed, 7 insertions, 4 deletions
diff --git a/platform/qt/qt.cmake b/platform/qt/qt.cmake
index 32ffe89bfe..cee0d1080c 100644
--- a/platform/qt/qt.cmake
+++ b/platform/qt/qt.cmake
@@ -31,8 +31,10 @@ set(MBGL_QT_FILES
PRIVATE platform/default/logging_stderr.cpp
# Thread pool
+ PRIVATE platform/default/mbgl/util/shared_thread_pool.cpp
+ PRIVATE platform/default/mbgl/util/shared_thread_pool.hpp
PRIVATE platform/default/mbgl/util/default_thread_pool.cpp
- PRIVATE platform/default/mbgl/util/default_thread_pool.cpp
+ PRIVATE platform/default/mbgl/util/default_thread_pool.hpp
# Platform integration
PRIVATE platform/qt/src/async_task.cpp
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index ca42f51ebd..cf9d5f39d6 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -22,6 +22,7 @@
#include <mbgl/util/geo.hpp>
#include <mbgl/util/geometry.hpp>
#include <mbgl/util/run_loop.hpp>
+#include <mbgl/util/shared_thread_pool.hpp>
#include <mbgl/util/traits.hpp>
#if QT_VERSION >= 0x050000
@@ -1532,10 +1533,10 @@ QMapboxGLPrivate::QMapboxGLPrivate(QMapboxGL *q, const QMapboxGLSettings &settin
settings.cacheDatabasePath().toStdString(),
settings.assetPath().toStdString(),
settings.cacheDatabaseMaximumSize()))
- , threadPool(4)
+ , threadPool(mbgl::sharedThreadPool())
, mapObj(std::make_unique<mbgl::Map>(
*this, mbgl::Size{ static_cast<uint32_t>(size.width()), static_cast<uint32_t>(size.height()) },
- pixelRatio, *fileSourceObj, threadPool,
+ pixelRatio, *fileSourceObj, *threadPool,
mbgl::MapMode::Continuous,
static_cast<mbgl::GLContextMode>(settings.contextMode()),
static_cast<mbgl::ConstrainMode>(settings.constrainMode()),
diff --git a/platform/qt/src/qmapboxgl_p.hpp b/platform/qt/src/qmapboxgl_p.hpp
index e2edf3f96c..6894e0de8b 100644
--- a/platform/qt/src/qmapboxgl_p.hpp
+++ b/platform/qt/src/qmapboxgl_p.hpp
@@ -38,7 +38,7 @@ public:
QMapboxGL *q_ptr { nullptr };
std::unique_ptr<mbgl::DefaultFileSource> fileSourceObj;
- mbgl::ThreadPool threadPool;
+ std::shared_ptr<mbgl::ThreadPool> threadPool;
std::unique_ptr<mbgl::Map> mapObj;
bool dirty { false };