[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
This commit is contained in:
@@ -60,7 +60,8 @@ NativeMapView::NativeMapView(JNIEnv *env_, jobject obj_, float pixelRatio_, int
|
||||
env(env_),
|
||||
pixelRatio(pixelRatio_),
|
||||
availableProcessors(availableProcessors_),
|
||||
totalMemory(totalMemory_) {
|
||||
totalMemory(totalMemory_),
|
||||
threadPool(4) {
|
||||
mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::NativeMapView");
|
||||
|
||||
assert(env_ != nullptr);
|
||||
@@ -81,7 +82,7 @@ NativeMapView::NativeMapView(JNIEnv *env_, jobject obj_, float pixelRatio_, int
|
||||
mbgl::android::cachePath + "/mbgl-offline.db",
|
||||
mbgl::android::apkPath);
|
||||
|
||||
map = std::make_unique<mbgl::Map>(*this, *fileSource, MapMode::Continuous);
|
||||
map = std::make_unique<mbgl::Map>(*this, *fileSource, threadPool, MapMode::Continuous);
|
||||
|
||||
float zoomFactor = map->getMaxZoom() - map->getMinZoom() + 1;
|
||||
float cpuFactor = availableProcessors;
|
||||
|
||||
Reference in New Issue
Block a user