#pragma once #include #include #include #include #include #include #include #include #include #include #include namespace mbgl { class BucketParameters; class CollisionTile; class SymbolBucket; class Anchor; class RenderLayer; class PlacedSymbol; namespace style { class Filter; } // namespace style class SymbolLayout { public: SymbolLayout(const BucketParameters&, const std::vector&, std::unique_ptr, ImageDependencies&, GlyphDependencies&); void prepare(const GlyphMap&, const GlyphPositions&, const ImageMap&, const ImagePositions&); std::unique_ptr place(CollisionTile&); bool hasSymbolInstances() const; std::map> layerPaintProperties; private: void addFeature(const size_t, const SymbolFeature&, const std::pair& shapedTextOrientations, optional shapedIcon, const GlyphPositionMap&); bool anchorIsTooClose(const std::u16string& text, const float repeatDistance, const Anchor&); std::map> compareText; void addToDebugBuffers(CollisionTile&, SymbolBucket&); // Adds placed items to the buffer. template void addSymbol(Buffer&, const Range sizeData, const SymbolQuad&, float scale, const bool keepUpright, const style::SymbolPlacementType, const Anchor& labelAnchor, PlacedSymbol& placedSymbol); // Stores the layer so that we can hold on to GeometryTileFeature instances in SymbolFeature, // which may reference data from this object. const std::unique_ptr sourceLayer; const std::string bucketName; const float overscaling; const float zoom; const MapMode mode; const float pixelRatio; style::SymbolLayoutProperties::PossiblyEvaluated layout; const uint32_t tileSize; const float tilePixelRatio; bool sdfIcons = false; bool iconsNeedLinear = false; style::TextSize::UnevaluatedType textSize; style::IconSize::UnevaluatedType iconSize; std::vector symbolInstances; std::vector features; BiDi bidi; // Consider moving this up to geometry tile worker to reduce reinstantiation costs; use of BiDi/ubiditransform object must be constrained to one thread }; } // namespace mbgl