From a6a529236ea307088e522b3e661f74a0537c99b7 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 11 Jan 2019 14:47:59 -0800 Subject: [PATCH] Fix comparator operator() definition. Comparators should be const. The libc++ update checks for this and rejects non-const comparators. Test: m Bug: None Change-Id: If2f76c020943b5bcb55803f0742990c9965afd6e --- graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp | 4 ++-- .../hwc2on1adapter/include/hwc2on1adapter/HWC2On1Adapter.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp b/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp index 366d6417e2..3d138f7308 100644 --- a/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp +++ b/graphics/composer/2.1/utils/hwc2on1adapter/HWC2On1Adapter.cpp @@ -1921,8 +1921,8 @@ HWC2On1Adapter::Layer::Layer(Display& display) mHwc1Id(0), mHasUnsupportedPlaneAlpha(false) {} -bool HWC2On1Adapter::SortLayersByZ::operator()( - const std::shared_ptr& lhs, const std::shared_ptr& rhs) { +bool HWC2On1Adapter::SortLayersByZ::operator()(const std::shared_ptr& lhs, + const std::shared_ptr& rhs) const { return lhs->getZ() < rhs->getZ(); } diff --git a/graphics/composer/2.1/utils/hwc2on1adapter/include/hwc2on1adapter/HWC2On1Adapter.h b/graphics/composer/2.1/utils/hwc2on1adapter/include/hwc2on1adapter/HWC2On1Adapter.h index 3badfce078..da771dc7af 100644 --- a/graphics/composer/2.1/utils/hwc2on1adapter/include/hwc2on1adapter/HWC2On1Adapter.h +++ b/graphics/composer/2.1/utils/hwc2on1adapter/include/hwc2on1adapter/HWC2On1Adapter.h @@ -130,8 +130,8 @@ private: class SortLayersByZ { public: - bool operator()(const std::shared_ptr& lhs, - const std::shared_ptr& rhs); + bool operator()(const std::shared_ptr& lhs, + const std::shared_ptr& rhs) const; }; // The semantics of the fences returned by the device differ between