[core] Ensure that a BackendScope exists when doing GL calls

This commit is contained in:
Konstantin Käfer
2017-02-27 18:33:16 +01:00
committed by John Firebaugh
parent d7227e13a7
commit 8e5214144e
20 changed files with 73 additions and 9 deletions

View File

@@ -10,6 +10,7 @@
#include <mbgl/style/conversion/layer.hpp>
#include <mbgl/style/conversion/filter.hpp>
#include <mbgl/sprite/sprite_image.cpp>
#include <mbgl/map/backend_scope.hpp>
#include <mbgl/map/query.hpp>
#include <unistd.h>
@@ -369,6 +370,7 @@ void NodeMap::startRender(NodeMap::RenderOptions options) {
static_cast<uint32_t>(options.height * pixelRatio) };
if (!view || view->getSize() != fbSize) {
view.reset();
mbgl::BackendScope scope { backend };
view = std::make_unique<mbgl::OffscreenView>(backend.getContext(), fbSize);
}