[core] Use GL_TRUE/GL_FALSE instead of true/false
This commit is contained in:
@@ -242,7 +242,11 @@ void Painter::renderPass(RenderPass pass_,
|
||||
pass == RenderPass::Opaque ? "opaque" : "translucent");
|
||||
}
|
||||
|
||||
config.blend = pass == RenderPass::Translucent;
|
||||
if (pass == RenderPass::Translucent) {
|
||||
config.blend = GL_TRUE;
|
||||
} else {
|
||||
config.blend = GL_FALSE;
|
||||
}
|
||||
|
||||
for (; it != end; ++it, i += increment) {
|
||||
currentLayer = i;
|
||||
@@ -398,8 +402,8 @@ void Painter::renderBackground(const BackgroundLayer& layer) {
|
||||
spriteAtlas->bind(true);
|
||||
}
|
||||
|
||||
config.stencilTest = false;
|
||||
config.depthTest = true;
|
||||
config.stencilTest = GL_FALSE;
|
||||
config.depthTest = GL_TRUE;
|
||||
config.depthRange = { 1.0f, 1.0f };
|
||||
|
||||
MBGL_CHECK_ERROR(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4));
|
||||
|
||||
@@ -18,7 +18,7 @@ void Painter::renderCircle(CircleBucket& bucket,
|
||||
// Abort early.
|
||||
if (pass == RenderPass::Opaque) return;
|
||||
|
||||
config.stencilTest = false;
|
||||
config.stencilTest = GL_FALSE;
|
||||
|
||||
const CirclePaintProperties& properties = layer.properties;
|
||||
mat4 vtxMatrix = translatedMatrix(matrix, properties.translate, id, properties.translateAnchor);
|
||||
|
||||
@@ -10,10 +10,10 @@ void Painter::drawClippingMasks(const std::set<Source*>& sources) {
|
||||
MBGL_DEBUG_GROUP("clipping masks");
|
||||
|
||||
config.program = plainShader->program;
|
||||
config.stencilTest = true;
|
||||
config.depthTest = true;
|
||||
config.stencilTest = GL_TRUE;
|
||||
config.depthTest = GL_TRUE;
|
||||
config.depthMask = GL_FALSE;
|
||||
config.colorMask = { false, false, false, false };
|
||||
config.colorMask = { GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE };
|
||||
config.depthRange = { 1.0f, 1.0f };
|
||||
|
||||
coveringPlainArray.bind(*plainShader, tileStencilBuffer, BUFFER_OFFSET_0);
|
||||
@@ -22,8 +22,7 @@ void Painter::drawClippingMasks(const std::set<Source*>& sources) {
|
||||
source->drawClippingMasks(*this);
|
||||
}
|
||||
|
||||
config.depthTest = true;
|
||||
config.colorMask = { true, true, true, true };
|
||||
config.colorMask = { GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE };
|
||||
config.depthMask = GL_TRUE;
|
||||
config.stencilMask = 0x0;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ void Painter::renderTileDebug(const Tile& tile) {
|
||||
void Painter::renderDebugText(TileData& tileData, const mat4 &matrix) {
|
||||
MBGL_DEBUG_GROUP("debug text");
|
||||
|
||||
config.depthTest = false;
|
||||
config.depthTest = GL_FALSE;
|
||||
|
||||
if (!tileData.debugBucket || tileData.debugBucket->state != tileData.getState()) {
|
||||
tileData.debugBucket = std::make_unique<DebugBucket>(tileData.id, tileData.getState());
|
||||
@@ -47,7 +47,7 @@ void Painter::renderDebugText(TileData& tileData, const mat4 &matrix) {
|
||||
config.lineWidth = 2.0f * data.pixelRatio;
|
||||
tileData.debugBucket->drawLines(*plainShader);
|
||||
|
||||
config.depthTest = true;
|
||||
config.depthTest = GL_TRUE;
|
||||
}
|
||||
|
||||
void Painter::renderDebugFrame(const mat4 &matrix) {
|
||||
@@ -56,8 +56,8 @@ void Painter::renderDebugFrame(const mat4 &matrix) {
|
||||
// Disable depth test and don't count this towards the depth buffer,
|
||||
// but *don't* disable stencil test, as we want to clip the red tile border
|
||||
// to the tile viewport.
|
||||
config.depthTest = false;
|
||||
config.stencilTest = true;
|
||||
config.depthTest = GL_FALSE;
|
||||
config.stencilTest = GL_TRUE;
|
||||
|
||||
config.program = plainShader->program;
|
||||
plainShader->u_matrix = matrix;
|
||||
|
||||
@@ -36,8 +36,8 @@ void Painter::renderFill(FillBucket& bucket, const FillLayer& layer, const TileI
|
||||
bool outline = properties.antialias && !pattern && stroke_color != fill_color;
|
||||
bool fringeline = properties.antialias && !pattern && stroke_color == fill_color;
|
||||
|
||||
config.stencilTest = true;
|
||||
config.depthTest = true;
|
||||
config.stencilTest = GL_TRUE;
|
||||
config.depthTest = GL_TRUE;
|
||||
|
||||
// Because we're drawing top-to-bottom, and we update the stencil mask
|
||||
// befrom, we have to draw the outline first (!)
|
||||
|
||||
@@ -17,8 +17,8 @@ void Painter::renderLine(LineBucket& bucket, const LineLayer& layer, const TileI
|
||||
// Abort early.
|
||||
if (pass == RenderPass::Opaque) return;
|
||||
|
||||
config.stencilTest = true;
|
||||
config.depthTest = true;
|
||||
config.stencilTest = GL_TRUE;
|
||||
config.depthTest = GL_TRUE;
|
||||
config.depthMask = GL_FALSE;
|
||||
|
||||
const auto& properties = layer.properties;
|
||||
|
||||
@@ -22,8 +22,8 @@ void Painter::renderRaster(RasterBucket& bucket, const RasterLayer& layer, const
|
||||
rasterShader->u_contrast_factor = contrastFactor(properties.contrast);
|
||||
rasterShader->u_spin_weights = spinWeights(properties.hue_rotate);
|
||||
|
||||
config.stencilTest = true;
|
||||
config.depthTest = true;
|
||||
config.stencilTest = GL_TRUE;
|
||||
config.depthTest = GL_TRUE;
|
||||
setDepthSublayer(0);
|
||||
bucket.drawRaster(*rasterShader, tileStencilBuffer, coveringRasterArray);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ void Painter::renderSymbol(SymbolBucket& bucket, const SymbolLayer& layer, const
|
||||
config.depthMask = GL_FALSE;
|
||||
|
||||
if (bucket.hasCollisionBoxData()) {
|
||||
config.stencilTest = true;
|
||||
config.stencilTest = GL_TRUE;
|
||||
|
||||
config.program = collisionBoxShader->program;
|
||||
collisionBoxShader->u_matrix = matrix;
|
||||
@@ -158,16 +158,20 @@ void Painter::renderSymbol(SymbolBucket& bucket, const SymbolLayer& layer, const
|
||||
|
||||
}
|
||||
|
||||
// TODO remove the `|| true` when #1673 is implemented
|
||||
const bool drawAcrossEdges = !(layout.text.allow_overlap || layout.icon.allow_overlap ||
|
||||
layout.text.ignore_placement || layout.icon.ignore_placement) || true;
|
||||
// TODO remove the `true ||` when #1673 is implemented
|
||||
const bool drawAcrossEdges = true || !(layout.text.allow_overlap || layout.icon.allow_overlap ||
|
||||
layout.text.ignore_placement || layout.icon.ignore_placement);
|
||||
|
||||
// Disable the stencil test so that labels aren't clipped to tile boundaries.
|
||||
//
|
||||
// Layers with features that may be drawn overlapping aren't clipped. These
|
||||
// layers are sorted in the y direction, and to draw the correct ordering near
|
||||
// tile edges the icons are included in both tiles and clipped when drawing.
|
||||
config.stencilTest = drawAcrossEdges ? false : true;
|
||||
if (drawAcrossEdges) {
|
||||
config.stencilTest = GL_FALSE;
|
||||
} else {
|
||||
config.stencilTest = GL_TRUE;
|
||||
}
|
||||
|
||||
if (bucket.hasIconData()) {
|
||||
config.depthTest = layout.icon.rotation_alignment == RotationAlignmentType::Map;
|
||||
|
||||
Reference in New Issue
Block a user