diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-04-16 17:44:34 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-04-29 11:37:39 +0200 |
commit | 08163713e239ab7756dc9bbe9b6e2c4986f168d3 (patch) | |
tree | 391c7da104dbe3d12fc0152cddaa7dfc8abbea74 /src/mbgl/renderer/paint_parameters.hpp | |
parent | 8f5e1ba20f7a356c5bdabb7cb9d0d10bb4d73e10 (diff) | |
download | qtlocation-mapboxgl-08163713e239ab7756dc9bbe9b6e2c4986f168d3.tar.gz |
[core] change approach to stencil clipping to (almost) match JS
Diffstat (limited to 'src/mbgl/renderer/paint_parameters.hpp')
-rw-r--r-- | src/mbgl/renderer/paint_parameters.hpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/mbgl/renderer/paint_parameters.hpp b/src/mbgl/renderer/paint_parameters.hpp index 523975c78c..1a576b6c9c 100644 --- a/src/mbgl/renderer/paint_parameters.hpp +++ b/src/mbgl/renderer/paint_parameters.hpp @@ -7,10 +7,11 @@ #include <mbgl/gfx/stencil_mode.hpp> #include <mbgl/gfx/color_mode.hpp> #include <mbgl/util/mat4.hpp> -#include <mbgl/algorithm/generate_clip_ids.hpp> #include <mbgl/text/placement.hpp> #include <array> +#include <map> +#include <vector> namespace mbgl { @@ -21,6 +22,8 @@ class TransformState; class ImageManager; class LineAtlas; class UnwrappedTileID; +class RenderSource; +class RenderTile; namespace gfx { class Context; @@ -62,13 +65,11 @@ public: float pixelRatio; Placement::VariableOffsets variableOffsets; std::array<float, 2> pixelsToGLUnits; - algorithm::ClipIDGenerator clipIDGenerator; Programs& programs; gfx::DepthMode depthModeForSublayer(uint8_t n, gfx::DepthMaskType) const; gfx::DepthMode depthModeFor3D(gfx::DepthMaskType) const; - gfx::StencilMode stencilModeForClipping(const ClipID&) const; gfx::ColorMode colorModeForRenderPass() const; mat4 matrixForTile(const UnwrappedTileID&, bool aligned = false) const; @@ -77,10 +78,24 @@ public: mat4 alignedProjMatrix; mat4 nearClippedProjMatrix; + // Stencil handling +public: + void renderTileClippingMasks(const std::vector<std::reference_wrapper<RenderTile>>&); + gfx::StencilMode stencilModeForClipping(const UnwrappedTileID&) const; + +private: + void clearStencil(); + + // This needs to be an ordered map so that we have the same order as the renderTiles. + std::map<UnwrappedTileID, int32_t> tileClippingMaskIDs; + int32_t nextStencilID = 1; + +public: int numSublayers = 3; uint32_t currentLayer; float depthRangeSize; const float depthEpsilon = 1.0f / (1 << 16); + float symbolFadeChange; }; |