[core] Added save/restore capabilities to GL config

This commit is contained in:
Bruno de Oliveira Abinader
2015-10-20 12:52:40 -07:00
parent a1c53d92e5
commit 54858dae8c
3 changed files with 130 additions and 1 deletions

View File

@@ -147,6 +147,10 @@ void Painter::render(const Style& style, TransformState state_, const FrameData&
state = state_;
frame = frame_;
if (data.contextMode == GLContextMode::Shared) {
config.restore();
}
glyphAtlas = style.glyphAtlas.get();
spriteAtlas = style.spriteAtlas.get();
lineAtlas = style.lineAtlas.get();
@@ -244,6 +248,10 @@ void Painter::render(const Style& style, TransformState state_, const FrameData&
MBGL_CHECK_ERROR(glBindTexture(GL_TEXTURE_2D, 0));
MBGL_CHECK_ERROR(VertexArrayObject::Unbind());
}
if (data.contextMode == GLContextMode::Shared) {
config.save();
}
}
template <class Iterator>