SF: Move color modes to DisplaySnapshot
Bug: 241285876
Test: dumpsys SurfaceFlinger --displays
Test: dumpsys SurfaceFlinger --wide-color
Change-Id: Ib546cd66950155102dbe021a2a764ad2c47d27fa
diff --git a/services/surfaceflinger/Display/DisplaySnapshot.h b/services/surfaceflinger/Display/DisplaySnapshot.h
index 3f34e39..23471f5 100644
--- a/services/surfaceflinger/Display/DisplaySnapshot.h
+++ b/services/surfaceflinger/Display/DisplaySnapshot.h
@@ -18,6 +18,7 @@
#include <optional>
+#include <ui/ColorMode.h>
#include <ui/DisplayId.h>
#include <ui/StaticDisplayInfo.h>
@@ -29,7 +30,7 @@
// Immutable state of a physical display, captured on hotplug.
class DisplaySnapshot {
public:
- DisplaySnapshot(PhysicalDisplayId, ui::DisplayConnectionType, DisplayModes&&,
+ DisplaySnapshot(PhysicalDisplayId, ui::DisplayConnectionType, DisplayModes&&, ui::ColorModes&&,
std::optional<DeviceProductInfo>&&);
DisplaySnapshot(const DisplaySnapshot&) = delete;
@@ -41,8 +42,11 @@
std::optional<DisplayModeId> translateModeId(hal::HWConfigId) const;
const auto& displayModes() const { return mDisplayModes; }
+ const auto& colorModes() const { return mColorModes; }
const auto& deviceProductInfo() const { return mDeviceProductInfo; }
+ ui::ColorModes filterColorModes(bool supportsWideColor) const;
+
void dump(utils::Dumper&) const;
private:
@@ -51,6 +55,7 @@
// Effectively const except in move constructor.
DisplayModes mDisplayModes;
+ ui::ColorModes mColorModes;
std::optional<DeviceProductInfo> mDeviceProductInfo;
};