diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2017-07-25 10:44:19 +0300 |
---|---|---|
committer | Ivo van Dongen <ivovandongen@users.noreply.github.com> | 2017-07-25 17:44:28 +0300 |
commit | 27343c6a75aba9c4d04b0362fc0e50889f0e2e69 (patch) | |
tree | 028cd06f534b09f1df7871cd11e0b726e0ce0377 /src/mbgl | |
parent | 906fc0421aa85308460586023cfe727501c9bbb5 (diff) | |
download | qtlocation-mapboxgl-27343c6a75aba9c4d04b0362fc0e50889f0e2e69.tar.gz |
[core] fix backend scope handling on render, cleanup and lowmemory
- Make renderer frontend responsible for creating a BackendScope on render
- encapsulate backend scope handling on cleanup and low memory in renderer impl
Diffstat (limited to 'src/mbgl')
-rw-r--r-- | src/mbgl/renderer/renderer_impl.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mbgl/renderer/renderer_impl.cpp b/src/mbgl/renderer/renderer_impl.cpp index 981c09e806..4c45ab167d 100644 --- a/src/mbgl/renderer/renderer_impl.cpp +++ b/src/mbgl/renderer/renderer_impl.cpp @@ -35,7 +35,7 @@ Renderer::Impl::Impl(RendererBackend& backend_, } Renderer::Impl::~Impl() { - BackendScope guard { backend, backend.getScopeType()}; + BackendScope guard { backend }; renderStyle.reset(); staticData.reset(); }; @@ -47,8 +47,8 @@ void Renderer::Impl::setObserver(RendererObserver* observer_) { void Renderer::Impl::render(View& view, const UpdateParameters& updateParameters) { // Don't load/render anyting in still mode until explicitly requested. if (updateParameters.mode == MapMode::Still && !updateParameters.stillImageRequest) return; - - BackendScope guard { backend, backend.getScopeType() }; + + assert(BackendScope::exists()); renderStyle->update(updateParameters); transformState = updateParameters.transformState; @@ -348,7 +348,7 @@ void Renderer::Impl::onResourceError(std::exception_ptr ptr) { } void Renderer::Impl::onLowMemory() { - BackendScope guard { backend, backend.getScopeType() }; + BackendScope guard { backend }; backend.getContext().performCleanup(); renderStyle->onLowMemory(); observer->onInvalidate(); |