[core] Make MapDebugOptions::StencilClip a no-op in Release mode

This commit is contained in:
Bruno de Oliveira Abinader
2016-07-18 15:02:35 +03:00
parent a709ea2656
commit 30f5aa72de
3 changed files with 7 additions and 0 deletions

View File

@@ -159,10 +159,12 @@ void Painter::render(const Style& style, const FrameData& frame_, SpriteAtlas& a
drawClippingMasks(parameters, generator.getStencils());
}
#if defined(DEBUG)
if (frame.debugOptions & MapDebugOptions::StencilClip) {
renderClipMasks();
return;
}
#endif
// Actually render the layers
if (debug::renderTree) { Log::Info(Event::Render, "{"); indent++; }

View File

@@ -86,7 +86,10 @@ public:
// Renders the red debug frame around a tile, visualizing its perimeter.
void renderDebugFrame(const mat4 &matrix);
#if defined(DEBUG)
// Renders tile clip boundaries, using stencil buffer to calculate fill color.
void renderClipMasks();
#endif
void renderDebugText(Tile&, const mat4&);
void renderFill(PaintParameters&, FillBucket&, const style::FillLayer&, const RenderTile&);

View File

@@ -87,6 +87,7 @@ void Painter::renderDebugFrame(const mat4 &matrix) {
MBGL_CHECK_ERROR(glDrawArrays(GL_LINE_STRIP, 0, (GLsizei)tileBorderBuffer.index()));
}
#if defined(DEBUG)
void Painter::renderClipMasks() {
config.stencilTest = GL_FALSE;
config.depthTest = GL_FALSE;
@@ -122,5 +123,6 @@ void Painter::renderClipMasks() {
MBGL_CHECK_ERROR(glDrawPixels(fbSize[0], fbSize[1], GL_LUMINANCE, GL_UNSIGNED_BYTE, pixels.get()));
#endif // GL_ES_VERSION_2_0
}
#endif // defined(DEBUG)
} // namespace mbgl