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.hpp26
1 files changed, 26 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..9944709b0d
--- /dev/null
+++ b/src/mbgl/renderer/source_state.hpp
@@ -0,0 +1,26 @@
+#pragma once
+
+#include <mbgl/style/conversion.hpp>
+#include <mbgl/util/feature.hpp>
+
+namespace mbgl {
+
+class RenderTile;
+using namespace style::conversion;
+
+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 coalesceChanges(std::vector<RenderTile>& tiles);
+
+private:
+ LayerFeatureStates currentStates;
+ LayerFeatureStates stateChanges;
+};
+
+} // namespace mbgl