[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`.
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
#include <mbgl/tile/vector_tile_data.hpp>
|
||||
#include <mbgl/tile/tile_loader_impl.hpp>
|
||||
|
||||
#include <mbgl/util/default_thread_pool.hpp>
|
||||
#include <mbgl/util/run_loop.hpp>
|
||||
#include <mbgl/map/transform.hpp>
|
||||
#include <mbgl/style/style.hpp>
|
||||
@@ -26,8 +25,7 @@ public:
|
||||
FakeFileSource fileSource;
|
||||
TransformState transformState;
|
||||
util::RunLoop loop;
|
||||
ThreadPool threadPool { 1 };
|
||||
style::Style style { loop, fileSource, 1 };
|
||||
style::Style style { fileSource, 1 };
|
||||
AnnotationManager annotationManager { style };
|
||||
ImageManager imageManager;
|
||||
GlyphManager glyphManager { fileSource };
|
||||
@@ -37,7 +35,6 @@ public:
|
||||
1.0,
|
||||
MapDebugOptions(),
|
||||
transformState,
|
||||
threadPool,
|
||||
fileSource,
|
||||
MapMode::Continuous,
|
||||
annotationManager,
|
||||
|
||||
Reference in New Issue
Block a user