diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-05-21 12:01:24 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-05-23 11:50:05 +0300 |
commit | 7143408f69618828bb37b8f38d719d3ceeeec9c2 (patch) | |
tree | 094a1d373129c1288331e3d9079e1ef8aeac1693 /src/mbgl/renderer/painter_fill.cpp | |
parent | 645dd25d0b8fa3ca39c2362083e7822f4a955fe4 (diff) | |
download | qtlocation-mapboxgl-7143408f69618828bb37b8f38d719d3ceeeec9c2.tar.gz |
[core] Implement MapDebugOptions::Wireframe
Together with MapDebugOptions::Collision, provides "wireframe" rendering
output so all drawn objects are visible. This mode ignores the line
width, background and fill colors for better visualization.
Fixes #4359.
Diffstat (limited to 'src/mbgl/renderer/painter_fill.cpp')
-rw-r--r-- | src/mbgl/renderer/painter_fill.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mbgl/renderer/painter_fill.cpp b/src/mbgl/renderer/painter_fill.cpp index 2e103462e6..1ac90a2806 100644 --- a/src/mbgl/renderer/painter_fill.cpp +++ b/src/mbgl/renderer/painter_fill.cpp @@ -33,11 +33,19 @@ void Painter::renderFill(FillBucket& bucket, stroke_color[3] *= properties.fillOpacity; } - const bool pattern = !properties.fillPattern.value.from.empty(); - + bool pattern = !properties.fillPattern.value.from.empty(); bool outline = properties.fillAntialias && !pattern && stroke_color != fill_color; bool fringeline = properties.fillAntialias && !pattern && stroke_color == fill_color; + bool wireframe = frame.debugOptions & MapDebugOptions::Wireframe; + if (wireframe) { + fill_color = {{ 1.0f, 1.0f, 1.0f, 1.0f }}; + stroke_color = {{ 1.0f, 1.0f, 1.0f, 1.0f }}; + pattern = false; + outline = true; + fringeline = true; + } + config.stencilOp.reset(); config.stencilTest = GL_TRUE; config.depthFunc.reset(); @@ -154,8 +162,7 @@ void Painter::renderFill(FillBucket& bucket, bucket.drawVertices(*outlinePatternShader, glObjectStore); } } - } - else { + } else if (!wireframe) { // No image fill. if ((fill_color[3] >= 1.0f) == (pass == RenderPass::Opaque)) { // Only draw the fill when it's either opaque and we're drawing opaque |