summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-02-28 11:23:26 +0100
committerKonstantin Käfer <mail@kkaefer.com>2019-03-01 09:33:37 +0100
commit4982933a78229085ee7a404fded70ad0cf2abc25 (patch)
tree022c4913aa389782bab7e202550eaf3468650c04 /src/mbgl/renderer
parentfde7c20f36ce2ecfdd79d2722fc2f0bee72e7e99 (diff)
downloadqtlocation-mapboxgl-4982933a78229085ee7a404fded70ad0cf2abc25.tar.gz
[core] move DepthMode to gfx namespace
Diffstat (limited to 'src/mbgl/renderer')
-rw-r--r--src/mbgl/renderer/layers/render_background_layer.cpp2
-rw-r--r--src/mbgl/renderer/layers/render_circle_layer.cpp2
-rw-r--r--src/mbgl/renderer/layers/render_custom_layer.cpp2
-rw-r--r--src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp4
-rw-r--r--src/mbgl/renderer/layers/render_fill_layer.cpp10
-rw-r--r--src/mbgl/renderer/layers/render_heatmap_layer.cpp4
-rw-r--r--src/mbgl/renderer/layers/render_hillshade_layer.cpp4
-rw-r--r--src/mbgl/renderer/layers/render_line_layer.cpp2
-rw-r--r--src/mbgl/renderer/layers/render_raster_layer.cpp2
-rw-r--r--src/mbgl/renderer/layers/render_symbol_layer.cpp8
-rw-r--r--src/mbgl/renderer/paint_parameters.cpp8
-rw-r--r--src/mbgl/renderer/paint_parameters.hpp6
-rw-r--r--src/mbgl/renderer/render_tile.cpp6
-rw-r--r--src/mbgl/renderer/renderer_impl.cpp6
-rw-r--r--src/mbgl/renderer/sources/render_image_source.cpp2
15 files changed, 34 insertions, 34 deletions
diff --git a/src/mbgl/renderer/layers/render_background_layer.cpp b/src/mbgl/renderer/layers/render_background_layer.cpp
index df22514677..21c209d5f0 100644
--- a/src/mbgl/renderer/layers/render_background_layer.cpp
+++ b/src/mbgl/renderer/layers/render_background_layer.cpp
@@ -68,7 +68,7 @@ void RenderBackgroundLayer::render(PaintParameters& parameters, RenderSource*) {
program.draw(
parameters.context,
gfx::Triangles(),
- parameters.depthModeForSublayer(0, gl::DepthMode::ReadOnly),
+ parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly),
gl::StencilMode::disabled(),
parameters.colorModeForRenderPass(),
gl::CullFaceMode::disabled(),
diff --git a/src/mbgl/renderer/layers/render_circle_layer.cpp b/src/mbgl/renderer/layers/render_circle_layer.cpp
index 888cc190a3..1754111335 100644
--- a/src/mbgl/renderer/layers/render_circle_layer.cpp
+++ b/src/mbgl/renderer/layers/render_circle_layer.cpp
@@ -97,7 +97,7 @@ void RenderCircleLayer::render(PaintParameters& parameters, RenderSource*) {
programInstance.draw(
parameters.context,
gfx::Triangles(),
- parameters.depthModeForSublayer(0, gl::DepthMode::ReadOnly),
+ parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly),
parameters.mapMode != MapMode::Continuous
? parameters.stencilModeForClipping(tile.clip)
: gl::StencilMode::disabled(),
diff --git a/src/mbgl/renderer/layers/render_custom_layer.cpp b/src/mbgl/renderer/layers/render_custom_layer.cpp
index 5ff0f1f812..4880919c36 100644
--- a/src/mbgl/renderer/layers/render_custom_layer.cpp
+++ b/src/mbgl/renderer/layers/render_custom_layer.cpp
@@ -62,7 +62,7 @@ void RenderCustomLayer::render(PaintParameters& paintParameters, RenderSource*)
// Reset GL state to a known state so the CustomLayer always has a clean slate.
glContext.bindVertexArray = 0;
- glContext.setDepthMode(paintParameters.depthModeForSublayer(0, gl::DepthMode::ReadOnly));
+ glContext.setDepthMode(paintParameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly));
glContext.setStencilMode(gl::StencilMode::disabled());
glContext.setColorMode(paintParameters.colorModeForRenderPass());
glContext.setCullFaceMode(gl::CullFaceMode::disabled());
diff --git a/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp b/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp
index 0552092f20..5ecd0fb7d4 100644
--- a/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp
+++ b/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp
@@ -93,7 +93,7 @@ void RenderFillExtrusionLayer::render(PaintParameters& parameters, RenderSource*
programInstance.draw(
parameters.context,
gfx::Triangles(),
- parameters.depthModeFor3D(gl::DepthMode::ReadWrite),
+ parameters.depthModeFor3D(gfx::DepthMaskType::ReadWrite),
gl::StencilMode::disabled(),
parameters.colorModeForRenderPass(),
gl::CullFaceMode::backCCW(),
@@ -194,7 +194,7 @@ void RenderFillExtrusionLayer::render(PaintParameters& parameters, RenderSource*
programInstance.draw(
parameters.context,
gfx::Triangles(),
- gl::DepthMode::disabled(),
+ gfx::DepthMode::disabled(),
gl::StencilMode::disabled(),
parameters.colorModeForRenderPass(),
gl::CullFaceMode::disabled(),
diff --git a/src/mbgl/renderer/layers/render_fill_layer.cpp b/src/mbgl/renderer/layers/render_fill_layer.cpp
index 303120d815..d529831997 100644
--- a/src/mbgl/renderer/layers/render_fill_layer.cpp
+++ b/src/mbgl/renderer/layers/render_fill_layer.cpp
@@ -121,8 +121,8 @@ void RenderFillLayer::render(PaintParameters& parameters, RenderSource*) {
draw(parameters.programs.getFillLayerPrograms().fill,
gfx::Triangles(),
parameters.depthModeForSublayer(1, parameters.pass == RenderPass::Opaque
- ? gl::DepthMode::ReadWrite
- : gl::DepthMode::ReadOnly),
+ ? gfx::DepthMaskType::ReadWrite
+ : gfx::DepthMaskType::ReadOnly),
*bucket.triangleIndexBuffer,
bucket.triangleSegments);
}
@@ -132,7 +132,7 @@ void RenderFillLayer::render(PaintParameters& parameters, RenderSource*) {
gfx::Lines{ 2.0f },
parameters.depthModeForSublayer(
unevaluated.get<FillOutlineColor>().isUndefined() ? 2 : 0,
- gl::DepthMode::ReadOnly),
+ gfx::DepthMaskType::ReadOnly),
*bucket.lineIndexBuffer,
bucket.lineSegments);
}
@@ -206,14 +206,14 @@ void RenderFillLayer::render(PaintParameters& parameters, RenderSource*) {
draw(parameters.programs.getFillLayerPrograms().fillPattern,
gfx::Triangles(),
- parameters.depthModeForSublayer(1, gl::DepthMode::ReadWrite),
+ parameters.depthModeForSublayer(1, gfx::DepthMaskType::ReadWrite),
*bucket.triangleIndexBuffer,
bucket.triangleSegments);
if (evaluated.get<FillAntialias>() && unevaluated.get<FillOutlineColor>().isUndefined()) {
draw(parameters.programs.getFillLayerPrograms().fillOutlinePattern,
gfx::Lines { 2.0f },
- parameters.depthModeForSublayer(2, gl::DepthMode::ReadOnly),
+ parameters.depthModeForSublayer(2, gfx::DepthMaskType::ReadOnly),
*bucket.lineIndexBuffer,
bucket.lineSegments);
}
diff --git a/src/mbgl/renderer/layers/render_heatmap_layer.cpp b/src/mbgl/renderer/layers/render_heatmap_layer.cpp
index ef0f378022..d03cb95261 100644
--- a/src/mbgl/renderer/layers/render_heatmap_layer.cpp
+++ b/src/mbgl/renderer/layers/render_heatmap_layer.cpp
@@ -120,7 +120,7 @@ void RenderHeatmapLayer::render(PaintParameters& parameters, RenderSource*) {
programInstance.draw(
parameters.context,
gfx::Triangles(),
- parameters.depthModeForSublayer(0, gl::DepthMode::ReadOnly),
+ parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly),
stencilMode,
gfx::ColorMode::additive(),
gl::CullFaceMode::disabled(),
@@ -168,7 +168,7 @@ void RenderHeatmapLayer::render(PaintParameters& parameters, RenderSource*) {
programInstance.draw(
parameters.context,
gfx::Triangles(),
- gl::DepthMode::disabled(),
+ gfx::DepthMode::disabled(),
gl::StencilMode::disabled(),
parameters.colorModeForRenderPass(),
gl::CullFaceMode::disabled(),
diff --git a/src/mbgl/renderer/layers/render_hillshade_layer.cpp b/src/mbgl/renderer/layers/render_hillshade_layer.cpp
index 9b94e5145c..732a0c909c 100644
--- a/src/mbgl/renderer/layers/render_hillshade_layer.cpp
+++ b/src/mbgl/renderer/layers/render_hillshade_layer.cpp
@@ -97,7 +97,7 @@ void RenderHillshadeLayer::render(PaintParameters& parameters, RenderSource* src
programInstance.draw(
parameters.context,
gfx::Triangles(),
- parameters.depthModeForSublayer(0, gl::DepthMode::ReadOnly),
+ parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly),
gl::StencilMode::disabled(),
parameters.colorModeForRenderPass(),
gl::CullFaceMode::disabled(),
@@ -158,7 +158,7 @@ void RenderHillshadeLayer::render(PaintParameters& parameters, RenderSource* src
programInstance.draw(
parameters.context,
gfx::Triangles(),
- parameters.depthModeForSublayer(0, gl::DepthMode::ReadOnly),
+ parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly),
gl::StencilMode::disabled(),
parameters.colorModeForRenderPass(),
gl::CullFaceMode::disabled(),
diff --git a/src/mbgl/renderer/layers/render_line_layer.cpp b/src/mbgl/renderer/layers/render_line_layer.cpp
index 98fedd9bd7..8b303890eb 100644
--- a/src/mbgl/renderer/layers/render_line_layer.cpp
+++ b/src/mbgl/renderer/layers/render_line_layer.cpp
@@ -88,7 +88,7 @@ void RenderLineLayer::render(PaintParameters& parameters, RenderSource*) {
programInstance.draw(
parameters.context,
gfx::Triangles(),
- parameters.depthModeForSublayer(0, gl::DepthMode::ReadOnly),
+ parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly),
parameters.stencilModeForClipping(tile.clip),
parameters.colorModeForRenderPass(),
gl::CullFaceMode::disabled(),
diff --git a/src/mbgl/renderer/layers/render_raster_layer.cpp b/src/mbgl/renderer/layers/render_raster_layer.cpp
index 666a2ab913..494ef0d094 100644
--- a/src/mbgl/renderer/layers/render_raster_layer.cpp
+++ b/src/mbgl/renderer/layers/render_raster_layer.cpp
@@ -111,7 +111,7 @@ void RenderRasterLayer::render(PaintParameters& parameters, RenderSource* source
programInstance.draw(
parameters.context,
gfx::Triangles(),
- parameters.depthModeForSublayer(0, gl::DepthMode::ReadOnly),
+ parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly),
gl::StencilMode::disabled(),
parameters.colorModeForRenderPass(),
gl::CullFaceMode::disabled(),
diff --git a/src/mbgl/renderer/layers/render_symbol_layer.cpp b/src/mbgl/renderer/layers/render_symbol_layer.cpp
index eb1ae26a8d..466e988cd0 100644
--- a/src/mbgl/renderer/layers/render_symbol_layer.cpp
+++ b/src/mbgl/renderer/layers/render_symbol_layer.cpp
@@ -118,8 +118,8 @@ void RenderSymbolLayer::render(PaintParameters& parameters, RenderSource*) {
parameters.context,
gfx::Triangles(),
values_.pitchAlignment == AlignmentType::Map
- ? parameters.depthModeForSublayer(0, gl::DepthMode::ReadOnly)
- : gl::DepthMode::disabled(),
+ ? parameters.depthModeForSublayer(0, gfx::DepthMaskType::ReadOnly)
+ : gfx::DepthMode::disabled(),
gl::StencilMode::disabled(),
parameters.colorModeForRenderPass(),
gl::CullFaceMode::disabled(),
@@ -252,7 +252,7 @@ void RenderSymbolLayer::render(PaintParameters& parameters, RenderSource*) {
parameters.programs.getSymbolLayerPrograms().collisionBox.draw(
parameters.context,
gfx::Lines { 1.0f },
- gl::DepthMode::disabled(),
+ gfx::DepthMode::disabled(),
gl::StencilMode::disabled(),
parameters.colorModeForRenderPass(),
gl::CullFaceMode::disabled(),
@@ -287,7 +287,7 @@ void RenderSymbolLayer::render(PaintParameters& parameters, RenderSource*) {
parameters.programs.getSymbolLayerPrograms().collisionCircle.draw(
parameters.context,
gfx::Triangles(),
- gl::DepthMode::disabled(),
+ gfx::DepthMode::disabled(),
gl::StencilMode::disabled(),
parameters.colorModeForRenderPass(),
gl::CullFaceMode::disabled(),
diff --git a/src/mbgl/renderer/paint_parameters.cpp b/src/mbgl/renderer/paint_parameters.cpp
index bdea5989d4..0c7ae7a857 100644
--- a/src/mbgl/renderer/paint_parameters.cpp
+++ b/src/mbgl/renderer/paint_parameters.cpp
@@ -58,14 +58,14 @@ mat4 PaintParameters::matrixForTile(const UnwrappedTileID& tileID, bool aligned)
return matrix;
}
-gl::DepthMode PaintParameters::depthModeForSublayer(uint8_t n, gl::DepthMode::Mask mask) const {
+gfx::DepthMode PaintParameters::depthModeForSublayer(uint8_t n, gfx::DepthMaskType mask) const {
float nearDepth = ((1 + currentLayer) * numSublayers + n) * depthEpsilon;
float farDepth = nearDepth + depthRangeSize;
- return gl::DepthMode { gl::DepthMode::LessEqual, mask, { nearDepth, farDepth } };
+ return gfx::DepthMode { gfx::DepthFunctionType::LessEqual, mask, { nearDepth, farDepth } };
}
-gl::DepthMode PaintParameters::depthModeFor3D(gl::DepthMode::Mask mask) const {
- return gl::DepthMode { gl::DepthMode::LessEqual, mask, { 0.0, 1.0 } };
+gfx::DepthMode PaintParameters::depthModeFor3D(gfx::DepthMaskType mask) const {
+ return gfx::DepthMode { gfx::DepthFunctionType::LessEqual, mask, { 0.0, 1.0 } };
}
gl::StencilMode PaintParameters::stencilModeForClipping(const ClipID& id) const {
diff --git a/src/mbgl/renderer/paint_parameters.hpp b/src/mbgl/renderer/paint_parameters.hpp
index 8045ef7291..ccfd12b409 100644
--- a/src/mbgl/renderer/paint_parameters.hpp
+++ b/src/mbgl/renderer/paint_parameters.hpp
@@ -4,7 +4,7 @@
#include <mbgl/renderer/render_light.hpp>
#include <mbgl/renderer/mode.hpp>
#include <mbgl/map/mode.hpp>
-#include <mbgl/gl/depth_mode.hpp>
+#include <mbgl/gfx/depth_mode.hpp>
#include <mbgl/gl/stencil_mode.hpp>
#include <mbgl/gfx/color_mode.hpp>
#include <mbgl/util/mat4.hpp>
@@ -61,8 +61,8 @@ public:
Programs& programs;
- gl::DepthMode depthModeForSublayer(uint8_t n, gl::DepthMode::Mask) const;
- gl::DepthMode depthModeFor3D(gl::DepthMode::Mask) const;
+ gfx::DepthMode depthModeForSublayer(uint8_t n, gfx::DepthMaskType) const;
+ gfx::DepthMode depthModeFor3D(gfx::DepthMaskType) const;
gl::StencilMode stencilModeForClipping(const ClipID&) const;
gfx::ColorMode colorModeForRenderPass() const;
diff --git a/src/mbgl/renderer/render_tile.cpp b/src/mbgl/renderer/render_tile.cpp
index 5aea1da023..358965847f 100644
--- a/src/mbgl/renderer/render_tile.cpp
+++ b/src/mbgl/renderer/render_tile.cpp
@@ -96,7 +96,7 @@ void RenderTile::finishRender(PaintParameters& parameters) {
program.draw(
parameters.context,
gfx::Lines { 4.0f * parameters.pixelRatio },
- gl::DepthMode::disabled(),
+ gfx::DepthMode::disabled(),
parameters.stencilModeForClipping(clip),
gfx::ColorMode::unblended(),
gl::CullFaceMode::disabled(),
@@ -118,7 +118,7 @@ void RenderTile::finishRender(PaintParameters& parameters) {
program.draw(
parameters.context,
gfx::Lines { 2.0f * parameters.pixelRatio },
- gl::DepthMode::disabled(),
+ gfx::DepthMode::disabled(),
parameters.stencilModeForClipping(clip),
gfx::ColorMode::unblended(),
gl::CullFaceMode::disabled(),
@@ -142,7 +142,7 @@ void RenderTile::finishRender(PaintParameters& parameters) {
parameters.programs.debug.draw(
parameters.context,
gfx::LineStrip { 4.0f * parameters.pixelRatio },
- gl::DepthMode::disabled(),
+ gfx::DepthMode::disabled(),
parameters.stencilModeForClipping(clip),
gfx::ColorMode::unblended(),
gl::CullFaceMode::disabled(),
diff --git a/src/mbgl/renderer/renderer_impl.cpp b/src/mbgl/renderer/renderer_impl.cpp
index d975d5d9a7..514d02808e 100644
--- a/src/mbgl/renderer/renderer_impl.cpp
+++ b/src/mbgl/renderer/renderer_impl.cpp
@@ -443,7 +443,7 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) {
program.draw(
parameters.context,
gfx::Triangles(),
- gl::DepthMode::disabled(),
+ gfx::DepthMode::disabled(),
gl::StencilMode {
gl::StencilMode::Always(),
static_cast<int32_t>(clipID.second.reference.to_ulong()),
@@ -478,7 +478,7 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) {
// Render tile clip boundaries, using stencil buffer to calculate fill color.
if (parameters.debugOptions & MapDebugOptions::StencilClip) {
parameters.context.setStencilMode(gl::StencilMode::disabled());
- parameters.context.setDepthMode(gl::DepthMode::disabled());
+ parameters.context.setDepthMode(gfx::DepthMode::disabled());
parameters.context.setColorMode(gfx::ColorMode::unblended());
parameters.context.program = 0;
@@ -561,7 +561,7 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) {
// Render the depth buffer.
if (parameters.debugOptions & MapDebugOptions::DepthBuffer) {
parameters.context.setStencilMode(gl::StencilMode::disabled());
- parameters.context.setDepthMode(gl::DepthMode::disabled());
+ parameters.context.setDepthMode(gfx::DepthMode::disabled());
parameters.context.setColorMode(gfx::ColorMode::unblended());
parameters.context.program = 0;
diff --git a/src/mbgl/renderer/sources/render_image_source.cpp b/src/mbgl/renderer/sources/render_image_source.cpp
index c2abb72962..25fa0ba038 100644
--- a/src/mbgl/renderer/sources/render_image_source.cpp
+++ b/src/mbgl/renderer/sources/render_image_source.cpp
@@ -64,7 +64,7 @@ void RenderImageSource::finishRender(PaintParameters& parameters) {
programInstance.draw(
parameters.context,
gfx::LineStrip { 4.0f * parameters.pixelRatio },
- gl::DepthMode::disabled(),
+ gfx::DepthMode::disabled(),
gl::StencilMode::disabled(),
gfx::ColorMode::unblended(),
gl::CullFaceMode::disabled(),