Name the ScreenCaptureOutput
Set a name for ScreenCaptureOutput based on whether it's used for region
sampling or not and include the display's id if present.
In Output's mNamePlusId, drop " (NA)" for those without a display id.
This would be extraneous on the ScreenCaptureOutput, which will mark the
display for which it's being used.
Bug: 262706813
Test: look at traces
Change-Id: If447795f3580601434cbcb6493f5fb7c3fa734c9
diff --git a/services/surfaceflinger/ScreenCaptureOutput.cpp b/services/surfaceflinger/ScreenCaptureOutput.cpp
index 37b3218..6d195b9 100644
--- a/services/surfaceflinger/ScreenCaptureOutput.cpp
+++ b/services/surfaceflinger/ScreenCaptureOutput.cpp
@@ -53,6 +53,13 @@
Rect sourceCrop = args.renderArea.getSourceCrop();
output->setDisplaySize({sourceCrop.getWidth(), sourceCrop.getHeight()});
+ {
+ std::string name = args.regionSampling ? "RegionSampling" : "ScreenCaptureOutput";
+ if (auto displayDevice = args.renderArea.getDisplayDevice()) {
+ base::StringAppendF(&name, " for %" PRIu64, displayDevice->getId().value);
+ }
+ output->setName(name);
+ }
return output;
}