From c9e53047c614d96785e497e4be0361b0b42c9a68 Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Sat, 22 Oct 2022 03:18:32 +0100 Subject: Add dump to DisplayInfo. This way it can be dumped as part of PointerController's dump. Bug: 254277939 Test: manually inspect `dumpsys input` Change-Id: I9ad71d14c81af390f5b9ccb4fa75439bd4496c26 --- libs/gui/DisplayInfo.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libs/gui/DisplayInfo.cpp') diff --git a/libs/gui/DisplayInfo.cpp b/libs/gui/DisplayInfo.cpp index 52d9540eeb..bd640df81e 100644 --- a/libs/gui/DisplayInfo.cpp +++ b/libs/gui/DisplayInfo.cpp @@ -20,8 +20,13 @@ #include #include +#include #include +#include + +#define INDENT " " + namespace android::gui { // --- DisplayInfo --- @@ -67,4 +72,17 @@ status_t DisplayInfo::writeToParcel(android::Parcel* parcel) const { return OK; } +void DisplayInfo::dump(std::string& out, const char* prefix) const { + using android::base::StringAppendF; + + out += prefix; + StringAppendF(&out, "DisplayViewport[id=%" PRId32 "]\n", displayId); + out += prefix; + StringAppendF(&out, INDENT "Width=%" PRId32 ", Height=%" PRId32 "\n", logicalWidth, + logicalHeight); + std::string transformPrefix(prefix); + transformPrefix.append(INDENT); + transform.dump(out, "Transform", transformPrefix.c_str()); +} + } // namespace android::gui -- cgit v1.2.3-59-g8ed1b