#pragma once #include #include #include #include #include #include #include #include #include #include #include "map_renderer.hpp" #include namespace mbgl { class RenderedQueryOptions; class SourceQueryOptions; namespace util { class AsyncTask; } // namespace util namespace android { class AndroidRendererFrontend : public RendererFrontend, public std::enable_shared_from_this { struct Private { explicit Private() = default; }; public: AndroidRendererFrontend(Private, jni::JNIEnv&, const jni::Object&); static std::shared_ptr create(jni::JNIEnv&, const jni::Object&); void init(jni::JNIEnv&, const jni::Object&); ~AndroidRendererFrontend() override; void reset() override; void setObserver(RendererObserver&) override; void update(std::shared_ptr) override; const TaggedScheduler& getThreadPool() const override; // Feature querying std::vector queryRenderedFeatures(const ScreenCoordinate&, const RenderedQueryOptions&) const; std::vector queryRenderedFeatures(const ScreenBox&, const RenderedQueryOptions&) const; std::vector querySourceFeatures(const std::string& sourceID, const SourceQueryOptions&) const; void setFeatureState(const std::string& sourceID, const std::optional& sourceLayerID, const std::string& featureID, const FeatureState& state) const; FeatureState getFeatureState(const std::string& sourceID, const std::optional& sourceLayerID, const std::string& featureID) const; void removeFeatureState(const std::string& sourceID, const std::optional& sourceLayerID, const std::optional& featureID, const std::optional& stateKey) const; AnnotationIDs queryPointAnnotations(const ScreenBox& box, const std::chrono::milliseconds& timeout) const; AnnotationIDs queryShapeAnnotations(const ScreenBox& box, const std::chrono::milliseconds& timeout) const; // Feature extension query FeatureExtensionValue queryFeatureExtensions(const std::string& sourceID, const Feature& feature, const std::string& extension, const std::string& extensionField, const std::optional>& args) const; // Memory void setTileCacheEnabled(bool); bool getTileCacheEnabled() const; void reduceMemoryUse(); private: MapRenderer& mapRenderer; util::RunLoop* mapRunLoop; std::unique_ptr updateAsyncTask; std::shared_ptr updateParams; }; } // namespace android } // namespace mbgl