Selectable renderer implementation (#1247)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
mwilsnd
2023-06-26 15:49:48 -05:00
committed by Bart Louwers
parent fe165c8924
commit 1963697687
64 changed files with 1189 additions and 316 deletions

View File

@@ -58,6 +58,40 @@ android {
buildConfigField "String", "MAPBOX_VERSION_STRING", String.format("\"Mapbox/%s\"", project.VERSION_NAME)
buildConfigField "String", "MAPBOX_EVENTS_USER_AGENT", String.format("\"mapbox-maps-android/%s\"", project.VERSION_NAME)
consumerProguardFiles 'proguard-rules.pro'
externalNativeBuild {
cmake {
arguments "-DMLN_LEGACY_RENDERER=ON", "-DMLN_DRAWABLE_RENDERER=OFF", "-DMLN_RENDERER_SPLIT_VIEW=OFF"
}
}
}
flavorDimensions += "renderer"
productFlavors {
create("legacy") {
dimension = "renderer"
externalNativeBuild {
cmake {
arguments "-DMLN_LEGACY_RENDERER=ON", "-DMLN_DRAWABLE_RENDERER=OFF", "-DMLN_RENDERER_SPLIT_VIEW=OFF"
}
}
}
create("drawable") {
dimension = "renderer"
externalNativeBuild {
cmake {
arguments "-DMLN_LEGACY_RENDERER=OFF", "-DMLN_DRAWABLE_RENDERER=ON", "-DMLN_RENDERER_SPLIT_VIEW=OFF"
}
}
}
create("split") {
dimension = "renderer"
externalNativeBuild {
cmake {
arguments "-DMLN_LEGACY_RENDERER=ON", "-DMLN_DRAWABLE_RENDERER=ON", "-DMLN_RENDERER_SPLIT_VIEW=ON"
}
}
}
}
// build native libraries
@@ -93,6 +127,7 @@ android {
debug {
testCoverageEnabled false
jniDebuggable true
debuggable true
}
}
namespace 'org.maplibre.android'

View File

@@ -37,4 +37,13 @@
# while we don't include this dependency directly
# a large amount of users combine it with our SDK
# we aren't able to provide a proguard config in that project (jar vs aar)
-dontwarn com.sun.xml.internal.ws.spi.db.*
-dontwarn com.sun.xml.internal.ws.spi.db.*
# okhttp
-dontwarn org.bouncycastle.jsse.BCSSLSocket
-dontwarn org.bouncycastle.jsse.BCSSLParameters
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
-dontwarn org.conscrypt.*
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE

View File

@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-feature
android:glEsVersion="0x00020000"
android:glEsVersion="0x00030000"
android:required="true"/>
<uses-feature
android:name="android.hardware.wifi"

View File

@@ -392,6 +392,10 @@ public class MapLibreGLSurfaceView extends SurfaceView implements SurfaceHolder.
mEglContext = null;
} else {
mEglConfig = view.eglConfigChooser.chooseConfig(mEgl, mEglDisplay);
if (mEglConfig == null) {
Log.e(TAG, "failed to select an EGL configuration");
return;
}
/*
* Create an EGL context. We want to do this as rarely as we can, because an