Use ScreenCaptureResults in screenCapture helper functions
It makes more sense to directly send the ScreenCaptureResults object to
the screenCapture helper functions so the render function can populate
the results. This makes it easier when adding new result values since
they likely want to be set for any screenshot path request.
Currently, the result object contains the buffer, whether secure layers
were captured, and the dataspace it was captured in.
Test: SurfaceFlinger_test
Bug: 162367424
Change-Id: I3b1f5264051bb2e885ce0d0df0cd18c8f55afdd1
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index c933d74..2552a01 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -719,22 +719,20 @@
using TraverseLayersFunction = std::function<void(const LayerVector::Visitor&)>;
using RenderAreaFuture = std::future<std::unique_ptr<RenderArea>>;
- void renderScreenImplLocked(const RenderArea& renderArea, TraverseLayersFunction traverseLayers,
- const sp<GraphicBuffer>& buffer, bool useIdentityTransform,
- bool regionSampling, int* outSyncFd);
+ status_t renderScreenImplLocked(const RenderArea& renderArea,
+ TraverseLayersFunction traverseLayers,
+ const sp<GraphicBuffer>& buffer, bool useIdentityTransform,
+ bool forSystem, int* outSyncFd, bool regionSampling,
+ ScreenCaptureResults& captureResults);
status_t captureScreenCommon(RenderAreaFuture, TraverseLayersFunction, ui::Size bufferSize,
- sp<GraphicBuffer>* outBuffer, ui::PixelFormat,
- bool useIdentityTransform, bool& outCapturedSecureLayers);
+ ui::PixelFormat, bool useIdentityTransform,
+ ScreenCaptureResults& captureResults);
status_t captureScreenCommon(RenderAreaFuture, TraverseLayersFunction, const sp<GraphicBuffer>&,
bool useIdentityTransform, bool regionSampling,
- bool& outCapturedSecureLayers);
+ ScreenCaptureResults& captureResults);
sp<DisplayDevice> getDisplayByIdOrLayerStack(uint64_t displayOrLayerStack) REQUIRES(mStateLock);
sp<DisplayDevice> getDisplayByLayerStack(uint64_t layerStack) REQUIRES(mStateLock);
- status_t captureScreenImplLocked(const RenderArea& renderArea,
- TraverseLayersFunction traverseLayers,
- const sp<GraphicBuffer>& buffer, bool useIdentityTransform,
- bool forSystem, int* outSyncFd, bool regionSampling,
- bool& outCapturedSecureLayers);
+
void traverseLayersInLayerStack(ui::LayerStack, const LayerVector::Visitor&);
sp<StartPropertySetThread> mStartPropertySetThread;