[Qt] Don't regen BackendScope on every QMapboxGL::render() call

This commit is contained in:
Bruno de Oliveira Abinader
2017-05-04 15:18:49 +03:00
parent 1b16be409a
commit 806da5d940
2 changed files with 4 additions and 1 deletions

View File

@@ -1510,7 +1510,9 @@ void QMapboxGL::render()
#endif
// The OpenGL implementation automatically enables the OpenGL context for us.
mbgl::BackendScope scope { *d_ptr, mbgl::BackendScope::ScopeType::Implicit };
if (!d_ptr->backendScope) {
d_ptr->backendScope = std::make_unique<mbgl::BackendScope>(*d_ptr, mbgl::BackendScope::ScopeType::Implicit);
}
d_ptr->dirty = false;
d_ptr->mapObj->render(*d_ptr);

View File

@@ -55,6 +55,7 @@ public:
std::unique_ptr<mbgl::DefaultFileSource> fileSourceObj;
std::shared_ptr<mbgl::ThreadPool> threadPool;
std::unique_ptr<mbgl::Map> mapObj;
std::unique_ptr<mbgl::BackendScope> backendScope;
bool dirty { false };