Use DisplayCaptureArgs for displayCapture functions.
Updated displayCapture functions to use the DisplayCaptureArgs and
ScreenCaptureResults instead of the list of arguments and out arguments.
This only updated the native code, not JNI or Java
Test: display screenshot + secure works
Test: adb shell screencap
Test: SurfaceFlinger_test
Bug: 162367424
Change-Id: I5210a0881c96436c128c3ffb328a5a6ee01beca7
diff --git a/services/surfaceflinger/tests/utils/ScreenshotUtils.h b/services/surfaceflinger/tests/utils/ScreenshotUtils.h
index 5480b00..ffdf55b 100644
--- a/services/surfaceflinger/tests/utils/ScreenshotUtils.h
+++ b/services/surfaceflinger/tests/utils/ScreenshotUtils.h
@@ -35,9 +35,12 @@
const auto sf = ComposerService::getComposerService();
SurfaceComposerClient::Transaction().apply(true);
- sp<GraphicBuffer> outBuffer;
- ASSERT_EQ(NO_ERROR, sf->captureScreen(displayToken, &outBuffer, Rect(), 0, 0, false));
- *sc = std::make_unique<ScreenCapture>(outBuffer);
+ DisplayCaptureArgs args;
+ args.displayToken = displayToken;
+
+ ScreenCaptureResults captureResults;
+ ASSERT_EQ(NO_ERROR, sf->captureDisplay(args, captureResults));
+ *sc = std::make_unique<ScreenCapture>(captureResults.buffer);
}
static void captureLayers(std::unique_ptr<ScreenCapture>* sc, sp<IBinder>& parentHandle,