diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2020-03-19 17:21:21 +0200 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2020-03-20 11:43:59 +0200 |
commit | 2ae96ad6879a00eba0b9115590f58e3eb3cbd019 (patch) | |
tree | d0363140001903fd200341441c573c3eee6b627f /src/mbgl/renderer | |
parent | bc45d65c58692cf0e21b4a932e4ba7bb674f12ba (diff) | |
download | qtlocation-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/renderer')
-rw-r--r-- | src/mbgl/renderer/render_orchestrator.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/render_orchestrator.hpp | 3 | ||||
-rw-r--r-- | src/mbgl/renderer/renderer.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/renderer/update_parameters.hpp | 5 |
4 files changed, 6 insertions, 10 deletions
diff --git a/src/mbgl/renderer/render_orchestrator.cpp b/src/mbgl/renderer/render_orchestrator.cpp index 985aac98b4..08338ff616 100644 --- a/src/mbgl/renderer/render_orchestrator.cpp +++ b/src/mbgl/renderer/render_orchestrator.cpp @@ -141,10 +141,6 @@ std::unique_ptr<RenderTree> RenderOrchestrator::createRenderTree( if (!isMapModeContinuous) { // Reset zoom history state. zoomHistory.first = true; - if (!updateParameters->keepRenderData && stillImageRequest != updateParameters->stillImageRequest) { - clearData(); - stillImageRequest = updateParameters->stillImageRequest; - } } if (LayerManager::annotationsEnabled) { diff --git a/src/mbgl/renderer/render_orchestrator.hpp b/src/mbgl/renderer/render_orchestrator.hpp index 312b28fd56..7c1abfe1f4 100644 --- a/src/mbgl/renderer/render_orchestrator.hpp +++ b/src/mbgl/renderer/render_orchestrator.hpp @@ -75,11 +75,11 @@ public: void reduceMemoryUse(); void dumpDebugLogs(); + void clearData(); private: bool isLoaded() const; bool hasTransitions(TimePoint) const; - void clearData(); RenderSource* getRenderSource(const std::string& id) const; @@ -127,7 +127,6 @@ private: const bool backgroundLayerAsColor; bool contextLost = false; - const void* stillImageRequest = nullptr; // Vectors with reserved capacity of layerImpls->size() to avoid reallocation // on each frame. diff --git a/src/mbgl/renderer/renderer.cpp b/src/mbgl/renderer/renderer.cpp index 5afbbbd47e..ac2f327a4e 100644 --- a/src/mbgl/renderer/renderer.cpp +++ b/src/mbgl/renderer/renderer.cpp @@ -131,4 +131,8 @@ void Renderer::reduceMemoryUse() { impl->orchestrator.reduceMemoryUse(); } +void Renderer::clearData() { + impl->orchestrator.clearData(); +} + } // namespace mbgl diff --git a/src/mbgl/renderer/update_parameters.hpp b/src/mbgl/renderer/update_parameters.hpp index fbdebc4197..4336fa0972 100644 --- a/src/mbgl/renderer/update_parameters.hpp +++ b/src/mbgl/renderer/update_parameters.hpp @@ -41,12 +41,9 @@ public: const uint8_t prefetchZoomDelta; // For still image requests, render requested - const void* stillImageRequest; + const bool stillImageRequest; const bool crossSourceCollisions; - - // If set, the render data from the previous render calls is kept. - const bool keepRenderData; }; } // namespace mbgl |