[core] Reset GL values when needed

This commit is contained in:
Bruno de Oliveira Abinader
2015-11-06 19:55:37 +02:00
parent 8894982625
commit 5ef5d08867
7 changed files with 29 additions and 2 deletions

View File

@@ -144,6 +144,7 @@ void Painter::renderSymbol(SymbolBucket& bucket, const SymbolLayer& layer, const
config.depthMask = GL_FALSE;
if (bucket.hasCollisionBoxData()) {
config.stencilOp.reset();
config.stencilTest = GL_TRUE;
config.program = collisionBoxShader->program;
@@ -170,11 +171,17 @@ void Painter::renderSymbol(SymbolBucket& bucket, const SymbolLayer& layer, const
if (drawAcrossEdges) {
config.stencilTest = GL_FALSE;
} else {
config.stencilOp.reset();
config.stencilTest = GL_TRUE;
}
if (bucket.hasIconData()) {
config.depthTest = layout.icon.rotation_alignment == RotationAlignmentType::Map;
if (layout.icon.rotation_alignment == RotationAlignmentType::Map) {
config.depthFunc.reset();
config.depthTest = GL_TRUE;
} else {
config.depthTest = GL_FALSE;
}
bool sdf = bucket.sdfIcons;
@@ -246,7 +253,12 @@ void Painter::renderSymbol(SymbolBucket& bucket, const SymbolLayer& layer, const
}
if (bucket.hasTextData()) {
config.depthTest = layout.text.rotation_alignment == RotationAlignmentType::Map;
if (layout.text.rotation_alignment == RotationAlignmentType::Map) {
config.depthFunc.reset();
config.depthTest = GL_TRUE;
} else {
config.depthTest = GL_FALSE;
}
glyphAtlas->bind();