summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/core-files.json7
-rw-r--r--platform/android/src/map_renderer.cpp4
-rwxr-xr-xplatform/android/src/native_map_view.cpp6
-rwxr-xr-xplatform/android/src/native_map_view.hpp2
-rw-r--r--platform/android/src/snapshotter/map_snapshotter.cpp5
-rw-r--r--platform/android/src/snapshotter/map_snapshotter.hpp2
-rw-r--r--platform/android/src/style/sources/geojson_source.cpp7
7 files changed, 8 insertions, 25 deletions
diff --git a/platform/android/core-files.json b/platform/android/core-files.json
index 20dcc12c7d..78764e99bc 100644
--- a/platform/android/core-files.json
+++ b/platform/android/core-files.json
@@ -88,10 +88,9 @@
"platform/default/src/mbgl/gl/headless_backend.cpp",
"platform/default/src/mbgl/gl/headless_frontend.cpp",
"platform/default/src/mbgl/map/map_snapshotter.cpp",
+ "platform/default/src/mbgl/platform/thread_pool.cpp",
"platform/default/src/mbgl/text/bidi.cpp",
- "platform/default/src/mbgl/util/default_thread_pool.cpp",
"platform/default/src/mbgl/util/png_writer.cpp",
- "platform/default/src/mbgl/util/shared_thread_pool.cpp",
"platform/default/src/mbgl/util/thread_local.cpp",
"platform/default/src/mbgl/util/utf.cpp",
"platform/linux/src/headless_backend_egl.cpp"
@@ -101,9 +100,7 @@
"mbgl/gl/headless_backend.hpp": "platform/default/include/mbgl/gl/headless_backend.hpp",
"mbgl/gl/headless_frontend.hpp": "platform/default/include/mbgl/gl/headless_frontend.hpp",
"mbgl/map/map_snapshotter.hpp": "platform/default/include/mbgl/map/map_snapshotter.hpp",
- "mbgl/text/unaccent.hpp": "platform/default/include/mbgl/text/unaccent.hpp",
- "mbgl/util/default_thread_pool.hpp": "platform/default/include/mbgl/util/default_thread_pool.hpp",
- "mbgl/util/shared_thread_pool.hpp": "platform/default/include/mbgl/util/shared_thread_pool.hpp"
+ "mbgl/text/unaccent.hpp": "platform/default/include/mbgl/text/unaccent.hpp"
},
"private_headers": {
"android_renderer_backend.hpp": "platform/android/src/android_renderer_backend.hpp",
diff --git a/platform/android/src/map_renderer.cpp b/platform/android/src/map_renderer.cpp
index cd8953e4cf..1974579b44 100644
--- a/platform/android/src/map_renderer.cpp
+++ b/platform/android/src/map_renderer.cpp
@@ -1,7 +1,6 @@
#include "map_renderer.hpp"
#include <mbgl/renderer/renderer.hpp>
-#include <mbgl/util/shared_thread_pool.hpp>
#include <mbgl/util/run_loop.hpp>
#include <string>
@@ -25,7 +24,6 @@ MapRenderer::MapRenderer(jni::JNIEnv& _env,
, fileSource(FileSource::getDefaultFileSource(_env, _fileSource))
, programCacheDir(jni::Make<std::string>(_env, programCacheDir_))
, localIdeographFontFamily(localIdeographFontFamily_ ? jni::Make<std::string>(_env, localIdeographFontFamily_) : optional<std::string>{})
- , threadPool(sharedThreadPool())
, mailbox(std::make_shared<Mailbox>(*this)) {
}
@@ -174,7 +172,7 @@ void MapRenderer::onSurfaceCreated(JNIEnv&) {
// Create the new backend and renderer
backend = std::make_unique<AndroidRendererBackend>();
- renderer = std::make_unique<Renderer>(*backend, pixelRatio, fileSource, *threadPool,
+ renderer = std::make_unique<Renderer>(*backend, pixelRatio, fileSource,
GLContextMode::Unique, programCacheDir, localIdeographFontFamily);
rendererRef = std::make_unique<ActorRef<Renderer>>(*renderer, mailbox);
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp
index 2f23f0b7d9..98aaedb7ab 100755
--- a/platform/android/src/native_map_view.cpp
+++ b/platform/android/src/native_map_view.cpp
@@ -20,7 +20,6 @@
#include <mbgl/util/exception.hpp>
#include <mbgl/util/geo.hpp>
#include <mbgl/util/image.hpp>
-#include <mbgl/util/shared_thread_pool.hpp>
#include <mbgl/util/logging.hpp>
#include <mbgl/util/platform.hpp>
#include <mbgl/util/projection.hpp>
@@ -65,8 +64,7 @@ NativeMapView::NativeMapView(jni::JNIEnv& _env,
jni::jboolean _crossSourceCollisions)
: javaPeer(_env, _obj)
, mapRenderer(MapRenderer::getNativePeer(_env, jMapRenderer))
- , pixelRatio(_pixelRatio)
- , threadPool(sharedThreadPool()) {
+ , pixelRatio(_pixelRatio) {
// Get a reference to the JavaVM for callbacks
if (_env.GetJavaVM(&vm) < 0) {
@@ -91,7 +89,7 @@ NativeMapView::NativeMapView(jni::JNIEnv& _env,
map = std::make_unique<mbgl::Map>(*rendererFrontend, *this,
mbgl::Size{ static_cast<uint32_t>(width),
static_cast<uint32_t>(height) }, pixelRatio,
- fileSource, *threadPool, options);
+ fileSource, options);
}
/**
diff --git a/platform/android/src/native_map_view.hpp b/platform/android/src/native_map_view.hpp
index 1bb4f23cbe..e0d239073b 100755
--- a/platform/android/src/native_map_view.hpp
+++ b/platform/android/src/native_map_view.hpp
@@ -4,7 +4,6 @@
#include <mbgl/map/camera.hpp>
#include <mbgl/map/map.hpp>
#include <mbgl/util/noncopyable.hpp>
-#include <mbgl/util/default_thread_pool.hpp>
#include <mbgl/util/run_loop.hpp>
#include <mbgl/storage/default_file_source.hpp>
#include <mbgl/storage/network_status.hpp>
@@ -258,7 +257,6 @@ private:
int height = 64;
// Ensure these are initialised last
- std::shared_ptr<mbgl::ThreadPool> threadPool;
std::unique_ptr<mbgl::Map> map;
mbgl::EdgeInsets insets;
};
diff --git a/platform/android/src/snapshotter/map_snapshotter.cpp b/platform/android/src/snapshotter/map_snapshotter.cpp
index 8eb1d02605..dd0ce6ea05 100644
--- a/platform/android/src/snapshotter/map_snapshotter.cpp
+++ b/platform/android/src/snapshotter/map_snapshotter.cpp
@@ -2,7 +2,6 @@
#include <mbgl/renderer/renderer.hpp>
#include <mbgl/style/style.hpp>
-#include <mbgl/util/shared_thread_pool.hpp>
#include <mbgl/util/logging.hpp>
#include <mbgl/util/string.hpp>
#include <mbgl/actor/scheduler.hpp>
@@ -27,8 +26,7 @@ MapSnapshotter::MapSnapshotter(jni::JNIEnv& _env,
const jni::String& _programCacheDir,
const jni::String& _localIdeographFontFamily)
: javaPeer(_env, _obj)
- , pixelRatio(_pixelRatio)
- , threadPool(sharedThreadPool()) {
+ , pixelRatio(_pixelRatio) {
// Get a reference to the JavaVM for callbacks
if (_env.GetJavaVM(&vm) < 0) {
@@ -60,7 +58,6 @@ MapSnapshotter::MapSnapshotter(jni::JNIEnv& _env,
showLogo = _showLogo;
// Create the core snapshotter
snapshotter = std::make_unique<mbgl::MapSnapshotter>(&fileSource,
- threadPool,
style,
size,
pixelRatio,
diff --git a/platform/android/src/snapshotter/map_snapshotter.hpp b/platform/android/src/snapshotter/map_snapshotter.hpp
index e8c0885ff1..791aa61d6a 100644
--- a/platform/android/src/snapshotter/map_snapshotter.hpp
+++ b/platform/android/src/snapshotter/map_snapshotter.hpp
@@ -1,7 +1,6 @@
#pragma once
#include <mbgl/map/map_snapshotter.hpp>
-#include <mbgl/util/default_thread_pool.hpp>
#include <mbgl/util/util.hpp>
#include "../file_source.hpp"
@@ -63,7 +62,6 @@ private:
float pixelRatio;
bool showLogo;
- std::shared_ptr<mbgl::ThreadPool> threadPool;
std::unique_ptr<Actor<mbgl::MapSnapshotter::Callback>> snapshotCallback;
std::unique_ptr<mbgl::MapSnapshotter> snapshotter;
diff --git a/platform/android/src/style/sources/geojson_source.cpp b/platform/android/src/style/sources/geojson_source.cpp
index a9307afe67..5ff4864275 100644
--- a/platform/android/src/style/sources/geojson_source.cpp
+++ b/platform/android/src/style/sources/geojson_source.cpp
@@ -17,7 +17,6 @@
#include "../conversion/url_or_tileset.hpp"
#include <string>
-#include <mbgl/util/shared_thread_pool.hpp>
// GeoJSONSource uses a "coalescing" model for high frequency asynchronous data update calls,
// which in practice means, that any update that started processing is going to finish
@@ -48,16 +47,14 @@ namespace android {
: Source(env, std::make_unique<mbgl::style::GeoJSONSource>(
jni::Make<std::string>(env, sourceId),
convertGeoJSONOptions(env, options)))
- , threadPool(sharedThreadPool())
- , converter(std::make_unique<Actor<FeatureConverter>>(*threadPool)) {
+ , converter(std::make_unique<Actor<FeatureConverter>>(Scheduler::GetBackground())) {
}
GeoJSONSource::GeoJSONSource(jni::JNIEnv& env,
mbgl::style::Source& coreSource,
AndroidRendererFrontend& frontend)
: Source(env, coreSource, createJavaPeer(env), frontend)
- , threadPool(sharedThreadPool())
- , converter(std::make_unique<Actor<FeatureConverter>>(*threadPool)) {
+ , converter(std::make_unique<Actor<FeatureConverter>>(Scheduler::GetBackground())) {
}
GeoJSONSource::~GeoJSONSource() = default;