summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/painter_symbol.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-09-27 13:00:27 +0200
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-09-27 11:03:29 -0700
commitce42d22984d19fa020e6fba77e2585c0fd9dacf4 (patch)
tree76e1a33a58bfb023987de1cc7aca59e649624db3 /src/mbgl/renderer/painter_symbol.cpp
parent21386b31465302d63cae5d93680442555c8560f1 (diff)
downloadqtlocation-mapboxgl-ce42d22984d19fa020e6fba77e2585c0fd9dacf4.tar.gz
[core] rename gl::Config to gl::Context
Diffstat (limited to 'src/mbgl/renderer/painter_symbol.cpp')
-rw-r--r--src/mbgl/renderer/painter_symbol.cpp50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/mbgl/renderer/painter_symbol.cpp b/src/mbgl/renderer/painter_symbol.cpp
index 2dded27c6c..635c81fbf7 100644
--- a/src/mbgl/renderer/painter_symbol.cpp
+++ b/src/mbgl/renderer/painter_symbol.cpp
@@ -20,7 +20,7 @@ void Painter::renderSDF(SymbolBucket& bucket,
float sdfFontSize,
std::array<float, 2> texsize,
SDFShader& sdfShader,
- void (SymbolBucket::*drawSDF)(SDFShader&, gl::ObjectStore&, gl::Config&, PaintMode),
+ void (SymbolBucket::*drawSDF)(SDFShader&, gl::ObjectStore&, gl::Context&, PaintMode),
// Layout
AlignmentType rotationAlignment,
@@ -60,7 +60,7 @@ void Painter::renderSDF(SymbolBucket& bucket,
}};
}
- config.program = sdfShader.getID();
+ context.program = sdfShader.getID();
sdfShader.u_matrix = vtxMatrix;
sdfShader.u_extrude_scale = extrudeScale;
sdfShader.u_texsize = texsize;
@@ -76,7 +76,7 @@ void Painter::renderSDF(SymbolBucket& bucket,
sdfShader.u_zoom = (state.getZoom() - zoomAdjust) * 10; // current zoom level
- frameHistory.bind(store, config, 1);
+ frameHistory.bind(store, context, 1);
sdfShader.u_fadetexture = 1;
// The default gamma value has to be adjust for the current pixelratio so that we're not
@@ -94,7 +94,7 @@ void Painter::renderSDF(SymbolBucket& bucket,
sdfShader.u_color = haloColor;
sdfShader.u_opacity = opacity;
sdfShader.u_buffer = (haloOffset - haloWidth / fontScale) / sdfPx;
- (bucket.*drawSDF)(sdfShader, store, config, paintMode());
+ (bucket.*drawSDF)(sdfShader, store, context, paintMode());
}
// Then, we draw the text/icon over the halo
@@ -103,7 +103,7 @@ void Painter::renderSDF(SymbolBucket& bucket,
sdfShader.u_color = color;
sdfShader.u_opacity = opacity;
sdfShader.u_buffer = (256.0f - 64.0f) / 256.0f;
- (bucket.*drawSDF)(sdfShader, store, config, paintMode());
+ (bucket.*drawSDF)(sdfShader, store, context, paintMode());
}
}
@@ -119,7 +119,7 @@ void Painter::renderSymbol(PaintParameters& parameters,
const auto& paint = layer.impl->paint;
const auto& layout = bucket.layout;
- config.depthMask = GL_FALSE;
+ context.depthMask = GL_FALSE;
// TODO remove the `true ||` when #1673 is implemented
const bool drawAcrossEdges = (frame.mapMode == MapMode::Continuous) && (true || !(layout.textAllowOverlap || layout.iconAllowOverlap ||
@@ -131,20 +131,20 @@ void Painter::renderSymbol(PaintParameters& parameters,
// 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.
if (drawAcrossEdges) {
- config.stencilTest = GL_FALSE;
+ context.stencilTest = GL_FALSE;
} else {
- config.stencilOp.reset();
- config.stencilTest = GL_TRUE;
+ context.stencilOp.reset();
+ context.stencilTest = GL_TRUE;
}
setDepthSublayer(0);
if (bucket.hasIconData()) {
if (layout.iconRotationAlignment == AlignmentType::Map) {
- config.depthFunc.reset();
- config.depthTest = GL_TRUE;
+ context.depthFunc.reset();
+ context.depthTest = GL_TRUE;
} else {
- config.depthTest = GL_FALSE;
+ context.depthTest = GL_FALSE;
}
bool sdf = bucket.sdfIcons;
@@ -160,7 +160,7 @@ void Painter::renderSymbol(PaintParameters& parameters,
SpriteAtlas* activeSpriteAtlas = layer.impl->spriteAtlas;
const bool iconScaled = fontScale != 1 || frame.pixelRatio != activeSpriteAtlas->getPixelRatio() || bucket.iconsNeedLinear;
const bool iconTransformed = layout.iconRotationAlignment == AlignmentType::Map || angleOffset != 0 || state.getPitch() != 0;
- activeSpriteAtlas->bind(sdf || state.isChanging() || iconScaled || iconTransformed, store, config, 0);
+ activeSpriteAtlas->bind(sdf || state.isChanging() || iconScaled || iconTransformed, store, context, 0);
if (sdf) {
renderSDF(bucket,
@@ -201,7 +201,7 @@ void Painter::renderSymbol(PaintParameters& parameters,
auto& iconShader = parameters.shaders.icon;
- config.program = iconShader.getID();
+ context.program = iconShader.getID();
iconShader.u_matrix = vtxMatrix;
iconShader.u_extrude_scale = extrudeScale;
iconShader.u_texsize = {{ float(activeSpriteAtlas->getWidth()) / 4.0f, float(activeSpriteAtlas->getHeight()) / 4.0f }};
@@ -213,22 +213,22 @@ void Painter::renderSymbol(PaintParameters& parameters,
iconShader.u_zoom = (state.getZoom() - zoomAdjust) * 10; // current zoom level
iconShader.u_opacity = paint.iconOpacity;
- frameHistory.bind(store, config, 1);
+ frameHistory.bind(store, context, 1);
iconShader.u_fadetexture = 1;
- bucket.drawIcons(iconShader, store, config, paintMode());
+ bucket.drawIcons(iconShader, store, context, paintMode());
}
}
if (bucket.hasTextData()) {
if (layout.textPitchAlignment == AlignmentType::Map) {
- config.depthFunc.reset();
- config.depthTest = GL_TRUE;
+ context.depthFunc.reset();
+ context.depthTest = GL_TRUE;
} else {
- config.depthTest = GL_FALSE;
+ context.depthTest = GL_FALSE;
}
- glyphAtlas->bind(store, config, 0);
+ glyphAtlas->bind(store, context, 0);
renderSDF(bucket,
tile,
@@ -250,19 +250,19 @@ void Painter::renderSymbol(PaintParameters& parameters,
}
if (bucket.hasCollisionBoxData()) {
- config.stencilOp.reset();
- config.stencilTest = GL_TRUE;
+ context.stencilOp.reset();
+ context.stencilTest = GL_TRUE;
auto& collisionBoxShader = shaders->collisionBox;
- config.program = collisionBoxShader.getID();
+ context.program = collisionBoxShader.getID();
collisionBoxShader.u_matrix = tile.matrix;
// TODO: This was the overscaled z instead of the canonical z.
collisionBoxShader.u_scale = std::pow(2, state.getZoom() - tile.id.canonical.z);
collisionBoxShader.u_zoom = state.getZoom() * 10;
collisionBoxShader.u_maxzoom = (tile.id.canonical.z + 1) * 10;
- config.lineWidth = 1.0f;
+ context.lineWidth = 1.0f;
- bucket.drawCollisionBoxes(collisionBoxShader, store, config);
+ bucket.drawCollisionBoxes(collisionBoxShader, store, context);
}
}