diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-07-18 15:02:35 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-07-20 12:48:52 +0300 |
commit | 30f5aa72de7a3c73acd35d16769991c802c8d29a (patch) | |
tree | 4f8df0d1a9827094e890597e9b7c26c83ecb5a91 /src | |
parent | a709ea26569351e2c60b497bb427c608ef9a20c5 (diff) | |
download | qtlocation-mapboxgl-30f5aa72de7a3c73acd35d16769991c802c8d29a.tar.gz |
[core] Make MapDebugOptions::StencilClip a no-op in Release mode
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/renderer/painter.cpp | 2 | ||||
-rw-r--r-- | src/mbgl/renderer/painter.hpp | 3 | ||||
-rw-r--r-- | src/mbgl/renderer/painter_debug.cpp | 2 |
3 files changed, 7 insertions, 0 deletions
diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp index bcae78cb42..b196c71b96 100644 --- a/src/mbgl/renderer/painter.cpp +++ b/src/mbgl/renderer/painter.cpp @@ -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++; } diff --git a/src/mbgl/renderer/painter.hpp b/src/mbgl/renderer/painter.hpp index 5248cd5104..b291c14b14 100644 --- a/src/mbgl/renderer/painter.hpp +++ b/src/mbgl/renderer/painter.hpp @@ -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&); diff --git a/src/mbgl/renderer/painter_debug.cpp b/src/mbgl/renderer/painter_debug.cpp index 1265d4eb5e..8bb8e9d646 100644 --- a/src/mbgl/renderer/painter_debug.cpp +++ b/src/mbgl/renderer/painter_debug.cpp @@ -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 |