Add display proto info
Currently display bounds are calculated in to layer bounds so when proto
files are uploaded, the display bounds are set at the root layer.
However, once display bounds are removed from layer bounds calculation,
the proto information will be missing display info and will be hard to
show a correct visual representation.
Add display proto info so winscope can properly show the display area.
Test: winscope works
Bug: 188792659
Change-Id: I445a892a855c302ab617a9c79bfbf5f217ac5349
diff --git a/services/surfaceflinger/SurfaceTracing.cpp b/services/surfaceflinger/SurfaceTracing.cpp
index b4d8a9a..5963737 100644
--- a/services/surfaceflinger/SurfaceTracing.cpp
+++ b/services/surfaceflinger/SurfaceTracing.cpp
@@ -137,14 +137,19 @@
return writeToFile();
}
+LayersTraceFileProto SurfaceTracing::createLayersTraceFileProto() {
+ LayersTraceFileProto fileProto;
+ fileProto.set_magic_number(uint64_t(LayersTraceFileProto_MagicNumber_MAGIC_NUMBER_H) << 32 |
+ LayersTraceFileProto_MagicNumber_MAGIC_NUMBER_L);
+ return fileProto;
+}
+
status_t SurfaceTracing::Runner::writeToFile() {
ATRACE_CALL();
- LayersTraceFileProto fileProto;
+ LayersTraceFileProto fileProto = createLayersTraceFileProto();
std::string output;
- fileProto.set_magic_number(uint64_t(LayersTraceFileProto_MagicNumber_MAGIC_NUMBER_H) << 32 |
- LayersTraceFileProto_MagicNumber_MAGIC_NUMBER_L);
mBuffer.flush(&fileProto);
mBuffer.reset(mConfig.bufferSize);
@@ -186,7 +191,7 @@
entry.set_excludes_composition_state(true);
}
entry.set_missed_entries(mMissedTraceEntries);
-
+ mFlinger.dumpDisplayProto(entry);
return entry;
}