From 387f80492bca3c050c0a152d3d1346f1f95724d3 Mon Sep 17 00:00:00 2001 From: Gali Nelle Date: Sun, 15 Mar 2020 15:48:16 +0200 Subject: Add comparison operator for CustomLayerRenderParameters --- include/mbgl/gl/custom_layer.hpp | 3 +++ src/mbgl/gl/custom_layer.cpp | 8 ++++++++ 2 files changed, 11 insertions(+) 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 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 -- cgit v1.2.1