diff options
author | Ander Conselvan de Oliveira <ander.deoliveira@mapbox.com> | 2019-08-27 14:25:55 +0300 |
---|---|---|
committer | Ander Conselvan de Oliveira <ander.deoliveira@mapbox.com> | 2019-08-27 16:23:48 +0300 |
commit | 21632a66f83e1e42bf6383f877d85a4fab4ad273 (patch) | |
tree | 9816cd8893accd71dc1d98ec9b20f40bd0cdd967 /platform | |
parent | 2c796a72aaa74d3fe91daeb90470073d1cf1f808 (diff) | |
download | qtlocation-mapboxgl-21632a66f83e1e42bf6383f877d85a4fab4ad273.tar.gz |
[core] Remove programCacheDir parameter from ProgramParameters
Binary shader support has been removed in commit c2f974f2a573 ([core]
Remove binary shader support). This left-over parameter is not used
anywhere anymore.
Diffstat (limited to 'platform')
16 files changed, 14 insertions, 42 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/MapRenderer.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/MapRenderer.java index 833a875a09..947ed35555 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/MapRenderer.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/renderer/MapRenderer.java @@ -8,7 +8,6 @@ import android.support.annotation.NonNull; import com.mapbox.mapboxsdk.LibraryLoader; import com.mapbox.mapboxsdk.log.Logger; import com.mapbox.mapboxsdk.maps.MapboxMap; -import com.mapbox.mapboxsdk.storage.FileSource; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; @@ -36,10 +35,9 @@ public abstract class MapRenderer implements MapRendererScheduler { public MapRenderer(@NonNull Context context, String localIdeographFontFamily) { float pixelRatio = context.getResources().getDisplayMetrics().density; - String programCacheDir = FileSource.getInternalCachePath(context); // Initialise native peer - nativeInitialize(this, pixelRatio, programCacheDir, localIdeographFontFamily); + nativeInitialize(this, pixelRatio, localIdeographFontFamily); } public void onStart() { @@ -119,7 +117,6 @@ public abstract class MapRenderer implements MapRendererScheduler { private native void nativeInitialize(MapRenderer self, float pixelRatio, - String programCacheDir, String localIdeographFontFamily); @CallSuper diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java index 4c70d13b17..1e0069c25f 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java @@ -339,11 +339,9 @@ public class MapSnapshotter { fileSource.setApiBaseUrl(apiBaseUrl); } - String programCacheDir = FileSource.getInternalCachePath(context); - nativeInitialize(this, fileSource, options.pixelRatio, options.width, options.height, options.styleUri, options.styleJson, options.region, options.cameraPosition, - options.showLogo, programCacheDir, options.localIdeographFontFamily); + options.showLogo, options.localIdeographFontFamily); } /** @@ -625,8 +623,7 @@ public class MapSnapshotter { FileSource fileSource, float pixelRatio, int width, int height, String styleUrl, String styleJson, LatLngBounds region, CameraPosition position, - boolean showLogo, String programCacheDir, - String localIdeographFontFamily); + boolean showLogo, String localIdeographFontFamily); @Keep protected native void nativeStart(); diff --git a/platform/android/src/map_renderer.cpp b/platform/android/src/map_renderer.cpp index 92444c404d..6be708b994 100644 --- a/platform/android/src/map_renderer.cpp +++ b/platform/android/src/map_renderer.cpp @@ -16,11 +16,9 @@ namespace android { MapRenderer::MapRenderer(jni::JNIEnv& _env, const jni::Object<MapRenderer>& obj, jni::jfloat pixelRatio_, - const jni::String& programCacheDir_, const jni::String& localIdeographFontFamily_) : javaPeer(_env, obj) , pixelRatio(pixelRatio_) - , programCacheDir(jni::Make<std::string>(_env, programCacheDir_)) , localIdeographFontFamily(localIdeographFontFamily_ ? jni::Make<std::string>(_env, localIdeographFontFamily_) : optional<std::string>{}) , mailbox(std::make_shared<Mailbox>(*this)) { } @@ -173,7 +171,7 @@ void MapRenderer::onSurfaceCreated(JNIEnv&) { // Create the new backend and renderer backend = std::make_unique<AndroidRendererBackend>(); - renderer = std::make_unique<Renderer>(*backend, pixelRatio, programCacheDir, localIdeographFontFamily); + renderer = std::make_unique<Renderer>(*backend, pixelRatio, localIdeographFontFamily); rendererRef = std::make_unique<ActorRef<Renderer>>(*renderer, mailbox); // Set the observer on the new Renderer implementation @@ -214,7 +212,7 @@ void MapRenderer::registerNative(jni::JNIEnv& env) { // Register the peer jni::RegisterNativePeer<MapRenderer>(env, javaClass, "nativePtr", - jni::MakePeer<MapRenderer, const jni::Object<MapRenderer>&, jni::jfloat, const jni::String&, const jni::String&>, + jni::MakePeer<MapRenderer, const jni::Object<MapRenderer>&, jni::jfloat, const jni::String&>, "nativeInitialize", "finalize", METHOD(&MapRenderer::render, "nativeRender"), METHOD(&MapRenderer::onRendererReset, "nativeReset"), diff --git a/platform/android/src/map_renderer.hpp b/platform/android/src/map_renderer.hpp index efbe55af7f..5a8ddeeb91 100644 --- a/platform/android/src/map_renderer.hpp +++ b/platform/android/src/map_renderer.hpp @@ -44,7 +44,6 @@ public: MapRenderer(jni::JNIEnv& _env, const jni::Object<MapRenderer>&, jni::jfloat pixelRatio, - const jni::String& programCacheDir, const jni::String& localIdeographFontFamily); ~MapRenderer() override; @@ -104,7 +103,6 @@ private: jni::WeakReference<jni::Object<MapRenderer>, jni::EnvAttachingDeleter> javaPeer; float pixelRatio; - std::string programCacheDir; optional<std::string> localIdeographFontFamily; std::shared_ptr<ThreadPool> threadPool; diff --git a/platform/android/src/snapshotter/map_snapshotter.cpp b/platform/android/src/snapshotter/map_snapshotter.cpp index 2eca6595e1..2d37710605 100644 --- a/platform/android/src/snapshotter/map_snapshotter.cpp +++ b/platform/android/src/snapshotter/map_snapshotter.cpp @@ -23,7 +23,6 @@ MapSnapshotter::MapSnapshotter(jni::JNIEnv& _env, const jni::Object<LatLngBounds>& region, const jni::Object<CameraPosition>& position, jni::jboolean _showLogo, - const jni::String& _programCacheDir, const jni::String& _localIdeographFontFamily) : javaPeer(_env, _obj) , pixelRatio(_pixelRatio) { @@ -61,7 +60,6 @@ MapSnapshotter::MapSnapshotter(jni::JNIEnv& _env, pixelRatio, cameraOptions, bounds, - jni::Make<std::string>(_env, _programCacheDir), _localIdeographFontFamily ? jni::Make<std::string>(_env, _localIdeographFontFamily) : optional<std::string>{}, @@ -161,7 +159,7 @@ void MapSnapshotter::registerNative(jni::JNIEnv& env) { // Register the peer jni::RegisterNativePeer<MapSnapshotter>(env, javaClass, "nativePtr", - jni::MakePeer<MapSnapshotter, const jni::Object<MapSnapshotter>&, const jni::Object<FileSource>&, jni::jfloat, jni::jint, jni::jint, const jni::String&, const jni::String&, const jni::Object<LatLngBounds>&, const jni::Object<CameraPosition>&, jni::jboolean, const jni::String&, const jni::String&>, + jni::MakePeer<MapSnapshotter, const jni::Object<MapSnapshotter>&, const jni::Object<FileSource>&, jni::jfloat, jni::jint, jni::jint, const jni::String&, const jni::String&, const jni::Object<LatLngBounds>&, const jni::Object<CameraPosition>&, jni::jboolean, const jni::String&>, "nativeInitialize", "finalize", METHOD(&MapSnapshotter::setStyleUrl, "setStyleUrl"), diff --git a/platform/android/src/snapshotter/map_snapshotter.hpp b/platform/android/src/snapshotter/map_snapshotter.hpp index 791aa61d6a..608a4c855f 100644 --- a/platform/android/src/snapshotter/map_snapshotter.hpp +++ b/platform/android/src/snapshotter/map_snapshotter.hpp @@ -34,7 +34,6 @@ public: const jni::Object<LatLngBounds>& region, const jni::Object<CameraPosition>& position, jni::jboolean showLogo, - const jni::String& programCacheDir, const jni::String& localIdeographFontFamily); ~MapSnapshotter(); diff --git a/platform/darwin/src/MGLMapSnapshotter.mm b/platform/darwin/src/MGLMapSnapshotter.mm index 65bed2cf42..0001ebcb86 100644 --- a/platform/darwin/src/MGLMapSnapshotter.mm +++ b/platform/darwin/src/MGLMapSnapshotter.mm @@ -624,7 +624,7 @@ const CGFloat MGLSnapshotterMinimumPixelSize = 64; // Create the snapshotter _mbglMapSnapshotter = std::make_unique<mbgl::MapSnapshotter>( - style, size, pixelRatio, cameraOptions, coordinateBounds, config.cacheDir, config.localFontFamilyName, resourceOptions); + style, size, pixelRatio, cameraOptions, coordinateBounds, config.localFontFamilyName, resourceOptions); } @end diff --git a/platform/darwin/src/MGLRendererConfiguration.h b/platform/darwin/src/MGLRendererConfiguration.h index bfe88b7209..0c539f86f1 100644 --- a/platform/darwin/src/MGLRendererConfiguration.h +++ b/platform/darwin/src/MGLRendererConfiguration.h @@ -20,9 +20,6 @@ MGL_EXPORT Based on the native scale where available, otherwise the standard screen scale. */ @property (nonatomic, readonly) const float scaleFactor; -/** The cache dir to use. */ -@property (nonatomic, readonly) mbgl::optional<std::string> cacheDir; - /** The name of the font family to use for client-side text rendering of CJK ideographs. Set MGLIdeographicFontFamilyName in your containing application's Info.plist to diff --git a/platform/darwin/src/MGLRendererConfiguration.mm b/platform/darwin/src/MGLRendererConfiguration.mm index 54bdcaa691..136dc929a6 100644 --- a/platform/darwin/src/MGLRendererConfiguration.mm +++ b/platform/darwin/src/MGLRendererConfiguration.mm @@ -66,10 +66,6 @@ static NSString * const MGLIdeographicFontFamilyNameKey = @"MGLIdeographicFontFa #endif } -- (mbgl::optional<std::string>)cacheDir { - return mbgl::optional<std::string>(); -} - - (mbgl::optional<std::string>)localFontFamilyName { return [self _localFontFamilyNameWithPropertyDictionary:[[NSBundle mainBundle] infoDictionary]]; } diff --git a/platform/default/include/mbgl/gfx/headless_frontend.hpp b/platform/default/include/mbgl/gfx/headless_frontend.hpp index 7f937b34b8..8f7a7bf202 100644 --- a/platform/default/include/mbgl/gfx/headless_frontend.hpp +++ b/platform/default/include/mbgl/gfx/headless_frontend.hpp @@ -17,12 +17,10 @@ class TransformState; class HeadlessFrontend : public RendererFrontend { public: HeadlessFrontend(float pixelRatio_, - const optional<std::string> programCacheDir = {}, gfx::ContextMode mode = gfx::ContextMode::Unique, const optional<std::string> localFontFamily = {}); HeadlessFrontend(Size, float pixelRatio_, - const optional<std::string> programCacheDir = {}, gfx::ContextMode mode = gfx::ContextMode::Unique, const optional<std::string> localFontFamily = {}); ~HeadlessFrontend() override; diff --git a/platform/default/include/mbgl/map/map_snapshotter.hpp b/platform/default/include/mbgl/map/map_snapshotter.hpp index db1ba1f267..c1544c36ab 100644 --- a/platform/default/include/mbgl/map/map_snapshotter.hpp +++ b/platform/default/include/mbgl/map/map_snapshotter.hpp @@ -31,7 +31,6 @@ public: const float pixelRatio, const optional<CameraOptions> cameraOptions, const optional<LatLngBounds> region, - const optional<std::string> cacheDir, const optional<std::string> localFontFamily, const ResourceOptions&); diff --git a/platform/default/src/mbgl/gfx/headless_frontend.cpp b/platform/default/src/mbgl/gfx/headless_frontend.cpp index f5e6b7f482..287567adbd 100644 --- a/platform/default/src/mbgl/gfx/headless_frontend.cpp +++ b/platform/default/src/mbgl/gfx/headless_frontend.cpp @@ -10,16 +10,14 @@ namespace mbgl { HeadlessFrontend::HeadlessFrontend(float pixelRatio_, - const optional<std::string> programCacheDir, const gfx::ContextMode contextMode, const optional<std::string> localFontFamily) : HeadlessFrontend( - { 256, 256 }, pixelRatio_, programCacheDir, contextMode, localFontFamily) { + { 256, 256 }, pixelRatio_, contextMode, localFontFamily) { } HeadlessFrontend::HeadlessFrontend(Size size_, float pixelRatio_, - const optional<std::string> programCacheDir, const gfx::ContextMode contextMode, const optional<std::string> localFontFamily) : size(size_), @@ -38,7 +36,7 @@ HeadlessFrontend::HeadlessFrontend(Size size_, renderer->render(*updateParameters_); } }), - renderer(std::make_unique<Renderer>(*getBackend(), pixelRatio, programCacheDir, localFontFamily)) { + renderer(std::make_unique<Renderer>(*getBackend(), pixelRatio, localFontFamily)) { } HeadlessFrontend::~HeadlessFrontend() = default; diff --git a/platform/default/src/mbgl/map/map_snapshotter.cpp b/platform/default/src/mbgl/map/map_snapshotter.cpp index f0b107e77e..5f4060e3f0 100644 --- a/platform/default/src/mbgl/map/map_snapshotter.cpp +++ b/platform/default/src/mbgl/map/map_snapshotter.cpp @@ -19,7 +19,6 @@ public: const float pixelRatio, const optional<CameraOptions> cameraOptions, const optional<LatLngBounds> region, - const optional<std::string> programCacheDir, const optional<std::string> localFontFamily, const ResourceOptions& resourceOptions); @@ -50,11 +49,10 @@ MapSnapshotter::Impl::Impl(const std::pair<bool, std::string> style, const float pixelRatio, const optional<CameraOptions> cameraOptions, const optional<LatLngBounds> region, - const optional<std::string> programCacheDir, const optional<std::string> localFontFamily, const ResourceOptions& resourceOptions) : frontend( - size, pixelRatio, programCacheDir, gfx::ContextMode::Unique, localFontFamily), + size, pixelRatio, gfx::ContextMode::Unique, localFontFamily), map(frontend, MapObserver::nullObserver(), MapOptions().withMapMode(MapMode::Static).withSize(size).withPixelRatio(pixelRatio), @@ -168,12 +166,11 @@ MapSnapshotter::MapSnapshotter(const std::pair<bool, std::string> style, const float pixelRatio, const optional<CameraOptions> cameraOptions, const optional<LatLngBounds> region, - const optional<std::string> programCacheDir, const optional<std::string> localFontFamily, const ResourceOptions& resourceOptions) : impl(std::make_unique<util::Thread<MapSnapshotter::Impl>>( "Map Snapshotter", style, size, pixelRatio, cameraOptions, - region, programCacheDir, localFontFamily, resourceOptions.clone())) {} + region, localFontFamily, resourceOptions.clone())) {} MapSnapshotter::~MapSnapshotter() = default; diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index 6d466bf2cf..2eafea1dd9 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -471,7 +471,7 @@ public: // setup mbgl map MGLRendererConfiguration *config = [MGLRendererConfiguration currentConfiguration]; - auto renderer = std::make_unique<mbgl::Renderer>(_mbglView->getRendererBackend(), config.scaleFactor, config.cacheDir, config.localFontFamilyName); + auto renderer = std::make_unique<mbgl::Renderer>(_mbglView->getRendererBackend(), config.scaleFactor, config.localFontFamilyName); BOOL enableCrossSourceCollisions = !config.perSourceCollisions; _rendererFrontend = std::make_unique<MGLRenderFrontend>(std::move(renderer), self, _mbglView->getRendererBackend()); diff --git a/platform/macos/src/MGLMapView.mm b/platform/macos/src/MGLMapView.mm index 3c9647571e..9a7cb437ec 100644 --- a/platform/macos/src/MGLMapView.mm +++ b/platform/macos/src/MGLMapView.mm @@ -276,7 +276,7 @@ public: MGLRendererConfiguration *config = [MGLRendererConfiguration currentConfiguration]; - auto renderer = std::make_unique<mbgl::Renderer>(_mbglView->getRendererBackend(), config.scaleFactor, config.cacheDir, config.localFontFamilyName); + auto renderer = std::make_unique<mbgl::Renderer>(_mbglView->getRendererBackend(), config.scaleFactor, config.localFontFamilyName); BOOL enableCrossSourceCollisions = !config.perSourceCollisions; _rendererFrontend = std::make_unique<MGLRenderFrontend>(std::move(renderer), self, _mbglView->getRendererBackend(), true); diff --git a/platform/qt/src/qmapboxgl_map_renderer.cpp b/platform/qt/src/qmapboxgl_map_renderer.cpp index eba50af6bf..8423470323 100644 --- a/platform/qt/src/qmapboxgl_map_renderer.cpp +++ b/platform/qt/src/qmapboxgl_map_renderer.cpp @@ -28,7 +28,7 @@ static auto *getScheduler() { QMapboxGLMapRenderer::QMapboxGLMapRenderer(qreal pixelRatio, QMapboxGLSettings::GLContextMode mode, const QString &localFontFamily) : m_backend(static_cast<mbgl::gfx::ContextMode>(mode)), - m_renderer(std::make_unique<mbgl::Renderer>(m_backend, pixelRatio, mbgl::optional<std::string> {}, + m_renderer(std::make_unique<mbgl::Renderer>(m_backend, pixelRatio, localFontFamily.isEmpty() ? mbgl::nullopt : mbgl::optional<std::string> { localFontFamily.toStdString() })) , m_forceScheduler(needsToForceScheduler()) { |