1 #pragma once 2 3 #include <mbgl/renderer/render_pass.hpp> 4 #include <mbgl/renderer/render_light.hpp> 5 #include <mbgl/renderer/mode.hpp> 6 #include <mbgl/map/mode.hpp> 7 #include <mbgl/gl/depth_mode.hpp> 8 #include <mbgl/gl/stencil_mode.hpp> 9 #include <mbgl/gl/color_mode.hpp> 10 #include <mbgl/util/mat4.hpp> 11 #include <mbgl/algorithm/generate_clip_ids.hpp> 12 13 #include <array> 14 15 namespace mbgl { 16 17 class RendererBackend; 18 class UpdateParameters; 19 class RenderStaticData; 20 class Programs; 21 class TransformState; 22 class ImageManager; 23 class LineAtlas; 24 class UnwrappedTileID; 25 26 class PaintParameters { 27 public: 28 PaintParameters(gl::Context&, 29 float pixelRatio, 30 GLContextMode, 31 RendererBackend&, 32 const UpdateParameters&, 33 const EvaluatedLight&, 34 RenderStaticData&, 35 ImageManager&, 36 LineAtlas&); 37 38 gl::Context& context; 39 RendererBackend& backend; 40 41 const TransformState& state; 42 const EvaluatedLight& evaluatedLight; 43 44 RenderStaticData& staticData; 45 ImageManager& imageManager; 46 LineAtlas& lineAtlas; 47 48 RenderPass pass = RenderPass::Opaque; 49 MapMode mapMode; 50 MapDebugOptions debugOptions; 51 GLContextMode contextMode; 52 TimePoint timePoint; 53 54 float pixelRatio; 55 std::array<float, 2> pixelsToGLUnits; 56 algorithm::ClipIDGenerator clipIDGenerator; 57 58 Programs& programs; 59 60 gl::DepthMode depthModeForSublayer(uint8_t n, gl::DepthMode::Mask) const; 61 gl::DepthMode depthModeFor3D(gl::DepthMode::Mask) const; 62 gl::StencilMode stencilModeForClipping(const ClipID&) const; 63 gl::ColorMode colorModeForRenderPass() const; 64 65 mat4 matrixForTile(const UnwrappedTileID&, bool aligned = false) const; 66 67 mat4 projMatrix; 68 mat4 alignedProjMatrix; 69 mat4 nearClippedProjMatrix; 70 71 int numSublayers = 3; 72 uint32_t currentLayer; 73 float depthRangeSize; 74 const float depthEpsilon = 1.0f / (1 << 16); 75 76 float symbolFadeChange; 77 }; 78 79 } // namespace mbgl 80