summaryrefslogtreecommitdiff
path: root/platform/darwin
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2019-02-14 16:56:17 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2019-05-10 14:20:38 +0300
commit06f1dc48a2fb317979ab48ce323115be5bd48f16 (patch)
tree5ef1e78a1f98a7a26034ca519e267bda235b2817 /platform/darwin
parent947bc75f56fae7f1e70f21b98730dc6b460b9194 (diff)
downloadqtlocation-mapboxgl-06f1dc48a2fb317979ab48ce323115be5bd48f16.tar.gz
[core] Make the BackgroundScheduler a singleton
- Do not carry it over everywhere as parameter, it is a shared instance anyway and the lifecycle is pretty much the app lifecycle from the moment we instantiate a map. - Rename to BackgroundScheduler because it is a Scheduler that will do tasks in the background, we don't make assumptions if it is a thread pool or a single thread. - Most importantly, remove the dependency from `core` on `platform`.
Diffstat (limited to 'platform/darwin')
-rw-r--r--platform/darwin/src/MGLMapSnapshotter.mm8
1 files changed, 1 insertions, 7 deletions
diff --git a/platform/darwin/src/MGLMapSnapshotter.mm b/platform/darwin/src/MGLMapSnapshotter.mm
index 171f24e4d0..65bed2cf42 100644
--- a/platform/darwin/src/MGLMapSnapshotter.mm
+++ b/platform/darwin/src/MGLMapSnapshotter.mm
@@ -8,9 +8,7 @@
#import <mbgl/map/camera.hpp>
#import <mbgl/storage/resource_options.hpp>
#import <mbgl/storage/default_file_source.hpp>
-#import <mbgl/util/default_thread_pool.hpp>
#import <mbgl/util/string.hpp>
-#import <mbgl/util/shared_thread_pool.hpp>
#import "MGLOfflineStorage_Private.h"
#import "MGLGeometry_Private.h"
@@ -125,7 +123,6 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64;
@end
@implementation MGLMapSnapshotter {
- std::shared_ptr<mbgl::ThreadPool> _mbglThreadPool;
std::unique_ptr<mbgl::MapSnapshotter> _mbglMapSnapshotter;
std::unique_ptr<mbgl::Actor<mbgl::MapSnapshotter::Callback>> _snapshotCallback;
}
@@ -176,7 +173,6 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64;
_mbglMapSnapshotter.reset();
_snapshotCallback.reset();
- _mbglThreadPool.reset();
self.terminated = YES;
}
@@ -591,8 +587,6 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64;
_options = options;
auto mbglFileSource = [[MGLOfflineStorage sharedOfflineStorage] mbglFileSource];
-
- _mbglThreadPool = mbgl::sharedThreadPool();
std::string styleURL = std::string([options.styleURL.absoluteString UTF8String]);
std::pair<bool, std::string> style = std::make_pair(false, styleURL);
@@ -630,7 +624,7 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64;
// Create the snapshotter
_mbglMapSnapshotter = std::make_unique<mbgl::MapSnapshotter>(
- _mbglThreadPool, style, size, pixelRatio, cameraOptions, coordinateBounds, config.cacheDir, config.localFontFamilyName, resourceOptions);
+ style, size, pixelRatio, cameraOptions, coordinateBounds, config.cacheDir, config.localFontFamilyName, resourceOptions);
}
@end