summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMike Morris <mikemorris@users.noreply.github.com>2016-10-12 17:28:22 -0400
committerMike Morris <mikemorris@users.noreply.github.com>2016-10-20 14:37:36 -0400
commit817c26111a0d6650e7ebae73e46621626106d0a7 (patch)
tree60a5206f2f7658b06b214d9b7435a65a243d6e83 /bin
parentab85fdb4524788ce7279e8ac362a0c1edbd5d5df (diff)
downloadqtlocation-mapboxgl-817c26111a0d6650e7ebae73e46621626106d0a7.tar.gz
[core] [node] pass thread pool impl to Map constructor
Updates mbgl::Map constructor usage everywhere Adds NodeThreadPool implementation using AsyncQueue to call Nan::AsyncQueueWorker from main thread
Diffstat (limited to 'bin')
-rw-r--r--bin/glfw.cpp5
-rw-r--r--bin/render.cpp6
2 files changed, 8 insertions, 3 deletions
diff --git a/bin/glfw.cpp b/bin/glfw.cpp
index 142095f8a2..c0d61820f8 100644
--- a/bin/glfw.cpp
+++ b/bin/glfw.cpp
@@ -4,6 +4,7 @@
#include <mbgl/platform/platform.hpp>
#include <mbgl/platform/default/settings_json.hpp>
#include <mbgl/platform/default/glfw_view.hpp>
+#include <mbgl/platform/default/thread_pool.hpp>
#include <mbgl/storage/default_file_source.hpp>
#include <signal.h>
@@ -115,7 +116,9 @@ int main(int argc, char *argv[]) {
fileSource.setAccessToken(std::string(token));
}
- mbgl::Map map(*view, fileSource);
+ mbgl::ThreadPool threadPool(4);
+
+ mbgl::Map map(*view, fileSource, threadPool);
// Load settings
mbgl::Settings_JSON settings;
diff --git a/bin/render.cpp b/bin/render.cpp
index a43bf32ddd..e4d9951c05 100644
--- a/bin/render.cpp
+++ b/bin/render.cpp
@@ -3,8 +3,9 @@
#include <mbgl/util/io.hpp>
#include <mbgl/util/run_loop.hpp>
-#include <mbgl/platform/default/headless_view.hpp>
#include <mbgl/platform/default/headless_display.hpp>
+#include <mbgl/platform/default/headless_view.hpp>
+#include <mbgl/platform/default/thread_pool.hpp>
#include <mbgl/storage/default_file_source.hpp>
#pragma GCC diagnostic push
@@ -84,7 +85,8 @@ int main(int argc, char *argv[]) {
}
HeadlessView view(pixelRatio, width, height);
- Map map(view, fileSource, MapMode::Still);
+ ThreadPool threadPool(4);
+ Map map(view, fileSource, threadPool, MapMode::Still);
map.setStyleJSON(style);
map.setClasses(classes);