#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; namespace style { class Filter; } // namespace style class SymbolLayout { public: SymbolLayout(const BucketParameters&, const std::vector&, const GeometryTileLayer&, IconDependencies&, GlyphDependencies&); void prepare(const GlyphPositionMap& glyphs, const IconMap& icons); std::unique_ptr place(CollisionTile&); bool hasSymbolInstances() const; enum State { Pending, // Waiting for the necessary glyphs or icons to be available. Placed // The final positions have been determined, taking into account prior layers. }; State state = Pending; std::map> layerPaintProperties; private: void addFeature(const size_t, const SymbolFeature&, const std::pair& shapedTextOrientations, optional shapedIcon, const GlyphPositions& face); 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&, SymbolSizeBinder& sizeBinder, const SymbolQuad&, const SymbolFeature& feature, float scale, const bool keepUpright, const style::SymbolPlacementType, const float placementAngle, WritingModeType writingModes); const std::string sourceLayerName; const std::string bucketName; const float overscaling; const float zoom; const MapMode mode; 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