[core] rename gl::Config to gl::Context

This commit is contained in:
Konstantin Käfer
2016-09-27 13:00:27 +02:00
committed by John Firebaugh
parent 21386b3146
commit ce42d22984
42 changed files with 341 additions and 342 deletions

View File

@@ -26,7 +26,7 @@ void Painter::renderTileDebug(const RenderTile& tile) {
void Painter::renderDebugText(Tile& tile, const mat4 &matrix) {
MBGL_DEBUG_GROUP("debug text");
config.depthTest = GL_FALSE;
context.depthTest = GL_FALSE;
if (!tile.debugBucket || tile.debugBucket->renderable != tile.isRenderable() ||
tile.debugBucket->complete != tile.isComplete() ||
@@ -39,28 +39,28 @@ void Painter::renderDebugText(Tile& tile, const mat4 &matrix) {
}
auto& plainShader = shaders->plain;
config.program = plainShader.getID();
context.program = plainShader.getID();
plainShader.u_matrix = matrix;
plainShader.u_opacity = 1.0f;
// Draw white outline
plainShader.u_color = Color::white();
config.lineWidth = 4.0f * frame.pixelRatio;
tile.debugBucket->drawLines(plainShader, store, config);
context.lineWidth = 4.0f * frame.pixelRatio;
tile.debugBucket->drawLines(plainShader, store, context);
#ifndef GL_ES_VERSION_2_0
// Draw line "end caps"
MBGL_CHECK_ERROR(glPointSize(2));
tile.debugBucket->drawPoints(plainShader, store, config);
tile.debugBucket->drawPoints(plainShader, store, context);
#endif
// Draw black text.
plainShader.u_color = Color::black();
config.lineWidth = 2.0f * frame.pixelRatio;
tile.debugBucket->drawLines(plainShader, store, config);
context.lineWidth = 2.0f * frame.pixelRatio;
tile.debugBucket->drawLines(plainShader, store, context);
config.depthFunc.reset();
config.depthTest = GL_TRUE;
context.depthFunc.reset();
context.depthTest = GL_TRUE;
}
void Painter::renderDebugFrame(const mat4 &matrix) {
@@ -69,32 +69,32 @@ void Painter::renderDebugFrame(const mat4 &matrix) {
// Disable depth test and don't count this towards the depth buffer,
// but *don't* disable stencil test, as we want to clip the red tile border
// to the tile viewport.
config.depthTest = GL_FALSE;
config.stencilOp.reset();
config.stencilTest = GL_TRUE;
context.depthTest = GL_FALSE;
context.stencilOp.reset();
context.stencilTest = GL_TRUE;
auto& plainShader = shaders->plain;
config.program = plainShader.getID();
context.program = plainShader.getID();
plainShader.u_matrix = matrix;
plainShader.u_opacity = 1.0f;
// draw tile outline
tileBorderArray.bind(plainShader, tileBorderBuffer, BUFFER_OFFSET_0, store, config);
tileBorderArray.bind(plainShader, tileBorderBuffer, BUFFER_OFFSET_0, store, context);
plainShader.u_color = { 1.0f, 0.0f, 0.0f, 1.0f };
config.lineWidth = 4.0f * frame.pixelRatio;
context.lineWidth = 4.0f * frame.pixelRatio;
MBGL_CHECK_ERROR(glDrawArrays(GL_LINE_STRIP, 0, (GLsizei)tileBorderBuffer.index()));
}
#ifndef NDEBUG
void Painter::renderClipMasks() {
config.stencilTest = GL_FALSE;
config.depthTest = GL_FALSE;
config.program = 0;
config.colorMask = { GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE };
context.stencilTest = GL_FALSE;
context.depthTest = GL_FALSE;
context.program = 0;
context.colorMask = { GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE };
#ifndef GL_ES_VERSION_2_0
config.pixelZoom = { 1, 1 };
config.rasterPos = {{ -1, -1, 0, 0 }};
context.pixelZoom = { 1, 1 };
context.rasterPos = {{ -1, -1, 0, 0 }};
// Read the stencil buffer
const auto& fbSize = frame.framebufferSize;
@@ -125,14 +125,14 @@ void Painter::renderClipMasks() {
#ifndef NDEBUG
void Painter::renderDepthBuffer() {
config.stencilTest = GL_FALSE;
config.depthTest = GL_FALSE;
config.program = 0;
config.colorMask = { GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE };
context.stencilTest = GL_FALSE;
context.depthTest = GL_FALSE;
context.program = 0;
context.colorMask = { GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE };
#ifndef GL_ES_VERSION_2_0
config.pixelZoom = { 1, 1 };
config.rasterPos = {{ -1, -1, 0, 0 }};
context.pixelZoom = { 1, 1 };
context.rasterPos = {{ -1, -1, 0, 0 }};
// Read the stencil buffer
const auto& fbSize = frame.framebufferSize;