#pragma once #include #include #include #include #include #include #include #include #include namespace mbgl { namespace gfx { class Texture2D; class UploadPass; using Texture2DPtr = std::shared_ptr; } // namespace gfx class Bucket; class LayerRenderData; class Tile; class TransformState; class PaintParameters; class DebugBucket; class SourcePrepareParameters; class FeatureIndex; class TileAtlasTextures; class TileRenderData; class RenderTile final { public: RenderTile(UnwrappedTileID, Tile&); ~RenderTile(); RenderTile(const RenderTile&) = delete; RenderTile(RenderTile&&) = default; RenderTile& operator=(const RenderTile&) = delete; UnwrappedTileID id; mat4 matrix; mat4 nearClippedMatrix; // Contains the tile ID string for painting debug information. std::unique_ptr debugBucket; mat4 translatedMatrix(const std::array& translation, style::TranslateAnchorType anchor, const TransformState&) const; mat4 translatedClipMatrix(const std::array& translation, style::TranslateAnchorType anchor, const TransformState&) const; const OverscaledTileID& getOverscaledTileID() const; bool holdForFade() const; Bucket* getBucket(const style::Layer::Impl&) const; const LayerRenderData* getLayerRenderData(const style::Layer::Impl&) const; std::optional getPattern(const std::string& pattern) const; bool hasGlyphAtlasTexture() const; const gfx::Texture2DPtr& getGlyphAtlasTexture() const; gfx::TextureBinding getGlyphAtlasTextureBinding(gfx::TextureFilterType) const; bool hasIconAtlasTexture() const; const gfx::Texture2DPtr& getIconAtlasTexture() const; gfx::TextureBinding getIconAtlasTextureBinding(gfx::TextureFilterType) const; const std::shared_ptr& getAtlasTextures() const; void upload(gfx::UploadPass&) const; void prepare(const SourcePrepareParameters&); void finishRender(PaintParameters&) const; static mat4 translateVtxMatrix(const UnwrappedTileID& id, const mat4& tileMatrix, const std::array& translation, style::TranslateAnchorType anchor, const TransformState& state, bool inViewportPixelUnits); mat4 translateVtxMatrix(const mat4& tileMatrix, const std::array& translation, style::TranslateAnchorType anchor, const TransformState& state, bool inViewportPixelUnits) const; void setFeatureState(const LayerFeatureStates&); private: Tile& tile; // The following members are reset at placement stage. std::unique_ptr renderData; bool needsRendering = false; }; } // namespace mbgl