summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/painter_symbol.cpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-10-26 19:36:43 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-11-18 09:13:53 +0100
commitce14037b552eafa9fa8da50f64bc562d95001309 (patch)
tree1d4ad3e8e7334a1062cd16ce1907d821d8c3954e /src/mbgl/renderer/painter_symbol.cpp
parent38fcbe21d48186c4630a3b8a76d1b20e156faadd (diff)
downloadqtlocation-mapboxgl-ce14037b552eafa9fa8da50f64bc562d95001309.tar.gz
[core] Cleanup symbol clipping
Diffstat (limited to 'src/mbgl/renderer/painter_symbol.cpp')
-rw-r--r--src/mbgl/renderer/painter_symbol.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/mbgl/renderer/painter_symbol.cpp b/src/mbgl/renderer/painter_symbol.cpp
index d4effe3f9d..39075976a0 100644
--- a/src/mbgl/renderer/painter_symbol.cpp
+++ b/src/mbgl/renderer/painter_symbol.cpp
@@ -35,16 +35,8 @@ void Painter::renderSymbol(PaintParameters& parameters,
const auto& buffers,
const SymbolPropertyValues& values_)
{
- // In some cases, we 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.
- //
- // TODO remove the `true ||` when #1673 is implemented
- const bool drawAcrossEdges = (frame.mapMode == MapMode::Continuous) && (true || !(layout.get<TextAllowOverlap>() || layout.get<IconAllowOverlap>() ||
- layout.get<TextIgnorePlacement>() || layout.get<IconIgnorePlacement>()));
+ // We clip symbols to their tile extent in still mode.
+ const bool needsClipping = frame.mapMode == MapMode::Still;
program.draw(
context,
@@ -52,9 +44,9 @@ void Painter::renderSymbol(PaintParameters& parameters,
values_.pitchAlignment == AlignmentType::Map
? depthModeForSublayer(0, gl::DepthMode::ReadOnly)
: gl::DepthMode::disabled(),
- drawAcrossEdges
- ? gl::StencilMode::disabled()
- : stencilModeForClipping(tile.clip),
+ needsClipping
+ ? stencilModeForClipping(tile.clip)
+ : gl::StencilMode::disabled(),
colorModeForRenderPass(),
std::move(uniformValues),
*buffers.vertexBuffer,