summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/RegionSamplingThread.cpp
diff options
context:
space:
mode:
author Melody Hsu <melodymhsu@google.com> 2025-02-11 07:58:26 +0000
committer Melody Hsu <melodymhsu@google.com> 2025-02-11 19:26:35 +0000
commit36cb1edb347a5b4b3bed0986e890fa070e9f9e79 (patch)
tree06ae53546c56a1224c21a5e39aa7f9e7dff4a2a3 /services/surfaceflinger/RegionSamplingThread.cpp
parent3b2e4214848187bc95230de63f25dd1c72e590b8 (diff)
Extract DisplayState elements into ScreenshotArgs
Only a subset of display state variables are needed for a screenshot and can be passed around in the existing ScreenshotArgs struct. This simplifies the parameter list passed around in screenshots and is a step toward refactoring screenshots to be cleaner and separated into a separate class. Ideally, once everything is split into a separate class, SF will deal with all the main thread work and provide the subset of screenshot arguments that are need by the yet-to-come screenshotter class. Bug: b/377758217 Test: atest SurfaceFlinger_test, atest CompositionTest Test: presubmit, screenshots, screen lock/unlock Flag: EXEMPT, refactor Change-Id: Id66d108824b5fab6f110867f2b86408928dc7519
Diffstat (limited to 'services/surfaceflinger/RegionSamplingThread.cpp')
-rw-r--r--services/surfaceflinger/RegionSamplingThread.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/services/surfaceflinger/RegionSamplingThread.cpp b/services/surfaceflinger/RegionSamplingThread.cpp
index 1c4a11a9fa..514adac20c 100644
--- a/services/surfaceflinger/RegionSamplingThread.cpp
+++ b/services/surfaceflinger/RegionSamplingThread.cpp
@@ -356,12 +356,10 @@ void RegionSamplingThread::captureSample() {
screenshotArgs.seamlessTransition = false;
std::vector<std::pair<Layer*, sp<LayerFE>>> layers;
- auto displayState =
- mFlinger.getSnapshotsFromMainThread(screenshotArgs, getLayerSnapshotsFn, layers);
- FenceResult fenceResult =
- mFlinger.captureScreenshot(screenshotArgs, buffer, kRegionSampling, kGrayscale,
- kIsProtected, nullptr, displayState, layers)
- .get();
+ mFlinger.getSnapshotsFromMainThread(screenshotArgs, getLayerSnapshotsFn, layers);
+ FenceResult fenceResult = mFlinger.captureScreenshot(screenshotArgs, buffer, kRegionSampling,
+ kGrayscale, kIsProtected, nullptr, layers)
+ .get();
if (fenceResult.ok()) {
fenceResult.value()->waitForever(LOG_TAG);
}