summaryrefslogtreecommitdiff
path: root/src/mbgl/map
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-03-19 17:21:21 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-03-20 11:43:59 +0200
commit2ae96ad6879a00eba0b9115590f58e3eb3cbd019 (patch)
treed0363140001903fd200341441c573c3eee6b627f /src/mbgl/map
parentbc45d65c58692cf0e21b4a932e4ba7bb674f12ba (diff)
downloadqtlocation-mapboxgl-2ae96ad6879a00eba0b9115590f58e3eb3cbd019.tar.gz
[core] Introduce Renderer::clearData() instead of keepRenderData map options
`Renderer::clearData()` is a better API than the removed `MapOptions::keepRenderData()`: - gives more flexibility to the client - similar to the existing `Renderer::reduceMemoryUse()` - the `MapOptions::keepRenderData()` API implementation could not handle the raise condition, which happened if the new still image request had come before all tiles from the previous requests were loaded. Co-authored-by: Dane Springmeyer <dane@mapbox.com>
Diffstat (limited to 'src/mbgl/map')
-rw-r--r--src/mbgl/map/map_impl.cpp6
-rw-r--r--src/mbgl/map/map_impl.hpp1
-rw-r--r--src/mbgl/map/map_options.cpp10
3 files changed, 2 insertions, 15 deletions
diff --git a/src/mbgl/map/map_impl.cpp b/src/mbgl/map/map_impl.cpp
index 60d4d6021c..0edc715134 100644
--- a/src/mbgl/map/map_impl.cpp
+++ b/src/mbgl/map/map_impl.cpp
@@ -17,7 +17,6 @@ Map::Impl::Impl(RendererFrontend& frontend_,
mode(mapOptions.mapMode()),
pixelRatio(mapOptions.pixelRatio()),
crossSourceCollisions(mapOptions.crossSourceCollisions()),
- keepRenderData(mapOptions.keepRenderData()),
fileSource(std::move(fileSource_)),
style(std::make_unique<style::Style>(fileSource, pixelRatio)),
annotationManager(*style) {
@@ -65,9 +64,8 @@ void Map::Impl::onUpdate() {
annotationManager.makeWeakPtr(),
fileSource,
prefetchZoomDelta,
- stillImageRequest.get(),
- crossSourceCollisions,
- keepRenderData};
+ bool(stillImageRequest),
+ crossSourceCollisions};
rendererFrontend.update(std::make_shared<UpdateParameters>(std::move(params)));
}
diff --git a/src/mbgl/map/map_impl.hpp b/src/mbgl/map/map_impl.hpp
index 56b18e4b2d..416662f9e5 100644
--- a/src/mbgl/map/map_impl.hpp
+++ b/src/mbgl/map/map_impl.hpp
@@ -59,7 +59,6 @@ public:
const MapMode mode;
const float pixelRatio;
const bool crossSourceCollisions;
- const bool keepRenderData;
MapDebugOptions debugOptions { MapDebugOptions::NoDebug };
diff --git a/src/mbgl/map/map_options.cpp b/src/mbgl/map/map_options.cpp
index 1e93125fd7..4cebb6adab 100644
--- a/src/mbgl/map/map_options.cpp
+++ b/src/mbgl/map/map_options.cpp
@@ -9,7 +9,6 @@ public:
ViewportMode viewportMode = ViewportMode::Default;
NorthOrientation orientation = NorthOrientation::Upwards;
bool crossSourceCollisions = true;
- bool keepRenderData = true;
Size size = { 64, 64 };
float pixelRatio = 1.0;
};
@@ -55,15 +54,6 @@ bool MapOptions::crossSourceCollisions() const {
return impl_->crossSourceCollisions;
}
-MapOptions& MapOptions::withKeepRenderData(bool keepRenderData_) {
- impl_->keepRenderData = keepRenderData_;
- return *this;
-}
-
-bool MapOptions::keepRenderData() const {
- return impl_->keepRenderData;
-}
-
MapOptions& MapOptions::withNorthOrientation(NorthOrientation orientation) {
impl_->orientation = orientation;
return *this;