From 36cb1edb347a5b4b3bed0986e890fa070e9f9e79 Mon Sep 17 00:00:00 2001 From: Melody Hsu Date: Tue, 11 Feb 2025 07:58:26 +0000 Subject: 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 --- services/surfaceflinger/RegionSamplingThread.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'services/surfaceflinger/RegionSamplingThread.cpp') 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>> 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); } -- cgit v1.2.3-59-g8ed1b