summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGali Nelle <galinelle.mapbox@gmail.com>2020-03-15 15:48:16 +0200
committerGali Nelle <galinelle.mapbox@gmail.com>2020-03-16 00:41:50 +0200
commit387f80492bca3c050c0a152d3d1346f1f95724d3 (patch)
tree2372a6a6dd3522635b2f9f6542c007814b1895d1
parent7d77a55fe05266ead14f20d49d9a19a5709d6a8e (diff)
downloadqtlocation-mapboxgl-upstream/galinelle_customLayerParametersComparison.tar.gz
Add comparison operator for CustomLayerRenderParametersupstream/galinelle_customLayerParametersComparison
-rw-r--r--include/mbgl/gl/custom_layer.hpp3
-rw-r--r--src/mbgl/gl/custom_layer.cpp8
2 files changed, 11 insertions, 0 deletions
diff --git a/include/mbgl/gl/custom_layer.hpp b/include/mbgl/gl/custom_layer.hpp
index 5dce484980..acbd2886b7 100644
--- a/include/mbgl/gl/custom_layer.hpp
+++ b/include/mbgl/gl/custom_layer.hpp
@@ -20,6 +20,9 @@ struct CustomLayerRenderParameters {
double pitch;
double fieldOfView;
std::array<double, 16> projectionMatrix;
+
+ bool operator==(const CustomLayerRenderParameters&) const;
+ bool operator!=(const CustomLayerRenderParameters&) const;
};
class CustomLayerHost {
diff --git a/src/mbgl/gl/custom_layer.cpp b/src/mbgl/gl/custom_layer.cpp
index 456467e904..04b4395e27 100644
--- a/src/mbgl/gl/custom_layer.cpp
+++ b/src/mbgl/gl/custom_layer.cpp
@@ -55,5 +55,13 @@ const LayerTypeInfo* CustomLayer::Impl::staticTypeInfo() noexcept {
return &typeInfoCustom;
}
+bool CustomLayerRenderParameters::operator==(const CustomLayerRenderParameters& o) const {
+ return projectionMatrix == o.projectionMatrix;
+}
+
+bool CustomLayerRenderParameters::operator!=(const CustomLayerRenderParameters& o) const {
+ return !(*this == o);
+}
+
} // namespace style
} // namespace mbgl