diff options
Diffstat (limited to 'platform/android/src')
-rwxr-xr-x | platform/android/src/native_map_view.cpp | 26 | ||||
-rwxr-xr-x | platform/android/src/native_map_view.hpp | 8 |
2 files changed, 23 insertions, 11 deletions
diff --git a/platform/android/src/native_map_view.cpp b/platform/android/src/native_map_view.cpp index af8ae16bf6..c65c241458 100755 --- a/platform/android/src/native_map_view.cpp +++ b/platform/android/src/native_map_view.cpp @@ -48,13 +48,18 @@ namespace mbgl { namespace android { -NativeMapView::NativeMapView(jni::JNIEnv& _env, jni::Object<NativeMapView> _obj, jni::Object<FileSource> jFileSource, - jni::jfloat _pixelRatio, jni::jint _availableProcessors, jni::jlong _totalMemory) : - javaPeer(_obj.NewWeakGlobalRef(_env)), - pixelRatio(_pixelRatio), - availableProcessors(_availableProcessors), - totalMemory(_totalMemory), - threadPool(sharedThreadPool()) { +NativeMapView::NativeMapView(jni::JNIEnv& _env, + jni::Object<NativeMapView> _obj, + jni::Object<FileSource> jFileSource, + jni::jfloat _pixelRatio, + jni::String _programCacheDir, + jni::jint _availableProcessors, + jni::jlong _totalMemory) + : javaPeer(_obj.NewWeakGlobalRef(_env)), + pixelRatio(_pixelRatio), + availableProcessors(_availableProcessors), + totalMemory(_totalMemory), + threadPool(sharedThreadPool()) { // Get a reference to the JavaVM for callbacks if (_env.GetJavaVM(&vm) < 0) { @@ -65,8 +70,9 @@ NativeMapView::NativeMapView(jni::JNIEnv& _env, jni::Object<NativeMapView> _obj, // Create the core map map = std::make_unique<mbgl::Map>( *this, mbgl::Size{ static_cast<uint32_t>(width), static_cast<uint32_t>(height) }, - pixelRatio, mbgl::android::FileSource::getDefaultFileSource(_env, jFileSource) - , *threadPool, MapMode::Continuous); + pixelRatio, mbgl::android::FileSource::getDefaultFileSource(_env, jFileSource), *threadPool, + MapMode::Continuous, GLContextMode::Unique, ConstrainMode::HeightOnly, + ViewportMode::Default, jni::Make<std::string>(_env, _programCacheDir)); //Calculate a fitting cache size based on device parameters float zoomFactor = map->getMaxZoom() - map->getMinZoom() + 1; @@ -1462,7 +1468,7 @@ void NativeMapView::registerNative(jni::JNIEnv& env) { // Register the peer jni::RegisterNativePeer<NativeMapView>(env, NativeMapView::javaClass, "nativePtr", - std::make_unique<NativeMapView, JNIEnv&, jni::Object<NativeMapView>, jni::Object<FileSource>, jni::jfloat, jni::jint, jni::jlong>, + std::make_unique<NativeMapView, JNIEnv&, jni::Object<NativeMapView>, jni::Object<FileSource>, jni::jfloat, jni::String, jni::jint, jni::jlong>, "nativeInitialize", "nativeDestroy", METHOD(&NativeMapView::render, "nativeRender"), diff --git a/platform/android/src/native_map_view.hpp b/platform/android/src/native_map_view.hpp index fbfe69040e..9a490ddbae 100755 --- a/platform/android/src/native_map_view.hpp +++ b/platform/android/src/native_map_view.hpp @@ -42,7 +42,13 @@ public: static void registerNative(jni::JNIEnv&); - NativeMapView(jni::JNIEnv&, jni::Object<NativeMapView>, jni::Object<FileSource>, jni::jfloat, jni::jint, jni::jlong); + NativeMapView(jni::JNIEnv&, + jni::Object<NativeMapView>, + jni::Object<FileSource>, + jni::jfloat pixelRatio, + jni::String programCacheDir, + jni::jint availableProcessors, + jni::jlong totalMemory); virtual ~NativeMapView(); |