From a4e96e0fe64ffa06978f3d05c571736a811d707f Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Tue, 19 Mar 2019 16:57:36 +0200 Subject: [core] Remove file source from public Map ctor --- platform/default/src/mbgl/map/map_snapshotter.cpp | 44 +++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'platform/default/src/mbgl/map/map_snapshotter.cpp') diff --git a/platform/default/src/mbgl/map/map_snapshotter.cpp b/platform/default/src/mbgl/map/map_snapshotter.cpp index 415ef7befd..cd8482e4ba 100644 --- a/platform/default/src/mbgl/map/map_snapshotter.cpp +++ b/platform/default/src/mbgl/map/map_snapshotter.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include @@ -14,15 +14,15 @@ namespace mbgl { class MapSnapshotter::Impl { public: - Impl(FileSource*, - std::shared_ptr, + Impl(std::shared_ptr, const std::pair style, const Size&, const float pixelRatio, const optional cameraOptions, const optional region, const optional programCacheDir, - const optional localFontFamily = {}); + const optional localFontFamily, + const ResourceOptions& resourceOptions); void setStyleURL(std::string styleURL); std::string getStyleURL() const; @@ -47,19 +47,18 @@ private: Map map; }; -MapSnapshotter::Impl::Impl(FileSource* fileSource, - std::shared_ptr scheduler_, - const std::pair style, - const Size& size, - const float pixelRatio, - const optional cameraOptions, - const optional region, - const optional programCacheDir, - const optional localFontFamily) - : scheduler(std::move(scheduler_)) - , frontend(size, pixelRatio, *scheduler, programCacheDir, GLContextMode::Unique, localFontFamily) - , map(frontend, MapObserver::nullObserver(), size, pixelRatio, *fileSource, *scheduler, MapOptions().withMapMode(MapMode::Static)) { - +MapSnapshotter::Impl::Impl(std::shared_ptr scheduler_, + const std::pair style, + const Size& size, + const float pixelRatio, + const optional cameraOptions, + const optional region, + const optional programCacheDir, + const optional localFontFamily, + const ResourceOptions& resourceOptions) + : scheduler(std::move(scheduler_)) + , frontend(size, pixelRatio, *scheduler, programCacheDir, GLContextMode::Unique, localFontFamily) + , map(frontend, MapObserver::nullObserver(), size, pixelRatio, *scheduler, MapOptions().withMapMode(MapMode::Static), resourceOptions) { if (style.first) { map.getStyle().loadJSON(style.second); } else{ @@ -164,17 +163,18 @@ LatLngBounds MapSnapshotter::Impl::getRegion() const { return map.latLngBoundsForCamera(getCameraOptions()); } -MapSnapshotter::MapSnapshotter(FileSource* fileSource, - std::shared_ptr scheduler, +MapSnapshotter::MapSnapshotter(std::shared_ptr scheduler, const std::pair style, const Size& size, const float pixelRatio, const optional cameraOptions, const optional region, const optional programCacheDir, - const optional localFontFamily) - : impl(std::make_unique>("Map Snapshotter", fileSource, std::move(scheduler), style, size, pixelRatio, cameraOptions, region, programCacheDir, localFontFamily)) { -} + const optional localFontFamily, + const ResourceOptions& resourceOptions) + : impl(std::make_unique>( + "Map Snapshotter", std::move(scheduler), style, size, pixelRatio, cameraOptions, + region, programCacheDir, localFontFamily, resourceOptions)) {} MapSnapshotter::~MapSnapshotter() = default; -- cgit v1.2.1