Add ScreenshotClient functionality for returning GraphicBuffer.
WM and SysUI are interested in screenshotting to GraphicBuffer, for
zero copy initialization of Starting Windows and usage in SysUI. Both
codepaths are co-existing in the WM now, so existing screenshot APIs
are not cleaned up, though perhaps they could be soon.
Test: Manual in combination with other branches.
Bug: 31339431
Change-Id: I11151f44eddbba53559befebf5ee2bde1dee9b40
diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h
index 9352c57..b86c72c 100644
--- a/include/gui/SurfaceComposerClient.h
+++ b/include/gui/SurfaceComposerClient.h
@@ -214,7 +214,13 @@
Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight,
uint32_t minLayerZ, uint32_t maxLayerZ,
bool useIdentityTransform);
-
+ static status_t captureToBuffer(
+ const sp<IBinder>& display,
+ Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight,
+ uint32_t minLayerZ, uint32_t maxLayerZ,
+ bool useIdentityTransform,
+ uint32_t rotation,
+ sp<GraphicBuffer>* outbuffer);
private:
mutable sp<CpuConsumer> mCpuConsumer;
mutable sp<IGraphicBufferProducer> mProducer;