summaryrefslogtreecommitdiff
path: root/libs/gui/DisplayInfo.cpp
diff options
context:
space:
mode:
author Michael Wright <michaelwr@google.com> 2022-10-22 03:18:32 +0100
committer Michael Wright <michaelwr@google.com> 2022-11-11 14:05:13 +0000
commitc9e53047c614d96785e497e4be0361b0b42c9a68 (patch)
treef983ada41ad6891f94bb1506112929105522a2c7 /libs/gui/DisplayInfo.cpp
parent08f7a6adfbf8e9dcabe89417b1305280093d7cce (diff)
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
Diffstat (limited to 'libs/gui/DisplayInfo.cpp')
-rw-r--r--libs/gui/DisplayInfo.cpp18
1 files changed, 18 insertions, 0 deletions
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 <gui/DisplayInfo.h>
#include <private/gui/ParcelUtils.h>
+#include <android-base/stringprintf.h>
#include <log/log.h>
+#include <inttypes.h>
+
+#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