#pragma once #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace mbgl { class GeometryTile; class GeometryTileData; class Layout; namespace style { class Layer; } // namespace style class GeometryTileWorker { public: GeometryTileWorker(ActorRef self, ActorRef parent, OverscaledTileID, std::string, const std::atomic&, MapMode, float pixelRatio, bool showCollisionBoxes_); ~GeometryTileWorker(); void setLayers(std::vector>, std::set availableImages, uint64_t correlationID); void setData(std::unique_ptr, std::set availableImages, uint64_t correlationID); void reset(uint64_t correlationID_); void setShowCollisionBoxes(bool showCollisionBoxes_, uint64_t correlationID_); void onGlyphsAvailable(GlyphMap newGlyphMap); void onImagesAvailable(ImageMap newIconMap, ImageMap newPatternMap, ImageVersionMap versionMap, uint64_t imageCorrelationID); private: void coalesced(); void parse(); void finalizeLayout(); void coalesce(); void requestNewGlyphs(const GlyphDependencies&); void requestNewImages(const ImageDependencies&); void symbolDependenciesChanged(); bool hasPendingDependencies() const; bool hasPendingParseResult() const; void checkPatternLayout(std::unique_ptr layout); ActorRef self; ActorRef parent; const OverscaledTileID id; const std::string sourceID; const std::atomic& obsolete; const MapMode mode; const float pixelRatio; std::unique_ptr featureIndex; std::unordered_map renderData; enum State { Idle, Coalescing, NeedsParse, NeedsSymbolLayout }; State state = Idle; uint64_t correlationID = 0; uint64_t imageCorrelationID = 0; // Outer optional indicates whether we've received it or not. optional>> layers; optional> data; std::vector> layouts; GlyphDependencies pendingGlyphDependencies; ImageDependencies pendingImageDependencies; GlyphMap glyphMap; ImageMap imageMap; ImageMap patternMap; ImageVersionMap versionMap; std::set availableImages; bool showCollisionBoxes; bool firstLoad = true; }; } // namespace mbgl