summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/source_state.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/renderer/source_state.hpp')
-rw-r--r--src/mbgl/renderer/source_state.hpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mbgl/renderer/source_state.hpp b/src/mbgl/renderer/source_state.hpp
new file mode 100644
index 0000000000..7217302630
--- /dev/null
+++ b/src/mbgl/renderer/source_state.hpp
@@ -0,0 +1,29 @@
+#pragma once
+
+#include <mbgl/style/conversion.hpp>
+#include <mbgl/util/feature.hpp>
+
+namespace mbgl {
+
+class RenderTile;
+
+class SourceFeatureState {
+public:
+ SourceFeatureState() = default;
+ ~SourceFeatureState() = default;
+
+ void updateState(const optional<std::string>& sourceLayerID, const std::string& featureID,
+ const FeatureState& newState);
+ void getState(FeatureState& result, const optional<std::string>& sourceLayerID, const std::string& featureID) const;
+ void removeState(const optional<std::string>& sourceLayerID, const optional<std::string>& featureID,
+ const optional<std::string>& stateKey);
+
+ void coalesceChanges(std::vector<RenderTile>& tiles);
+
+private:
+ LayerFeatureStates currentStates;
+ LayerFeatureStates stateChanges;
+ LayerFeatureStates deletedStates;
+};
+
+} // namespace mbgl