summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/ScreenCaptureOutput.cpp
diff options
context:
space:
mode:
author Leon Scroggins III <scroggo@google.com> 2023-01-05 13:03:53 -0500
committer Leon Scroggins III <scroggo@google.com> 2023-01-12 16:21:17 -0500
commitc03d4659733145dd256e3f4a69f20c0156d21969 (patch)
tree5a0253da32463f10279916d118854a0f3db9e0e2 /services/surfaceflinger/ScreenCaptureOutput.cpp
parent7d089caad4b61600d0d876d18b13f0fb1d255685 (diff)
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
Diffstat (limited to 'services/surfaceflinger/ScreenCaptureOutput.cpp')
-rw-r--r--services/surfaceflinger/ScreenCaptureOutput.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/services/surfaceflinger/ScreenCaptureOutput.cpp b/services/surfaceflinger/ScreenCaptureOutput.cpp
index 37b3218138..6d195b9f7b 100644
--- a/services/surfaceflinger/ScreenCaptureOutput.cpp
+++ b/services/surfaceflinger/ScreenCaptureOutput.cpp
@@ -53,6 +53,13 @@ std::shared_ptr<ScreenCaptureOutput> createScreenCaptureOutput(ScreenCaptureOutp
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;
}