summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author chaviw <chaviw@google.com> 2017-09-20 12:02:26 -0700
committer chaviw <chaviw@google.com> 2017-10-26 17:39:24 -0700
commita76b271f0e14325fa0ebb98e1cac0a15adfea1cb (patch)
treee13158ef19eed46d32d6a0984da3fe1645206fe6 /libs/gui/SurfaceComposerClient.cpp
parentcd8ad33289b74243e21a776a5a9170c845d990c4 (diff)
Add captureLayers function to capture a layer and its children.
The captureLayers function gets a root layer as its argument. It will capture the content for that layer and its descendants. The capture will set the root layer's transform back to (0, 0). Test: Transaction_test ScreenCaptureTest Change-Id: I84fb66a65cd91434cddc99506b1924cf9f950935
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 40e319e28a..15c4c9a880 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -731,6 +731,15 @@ status_t ScreenshotClient::captureToBuffer(const sp<IBinder>& display,
return ret;
}
+status_t ScreenshotClient::captureLayers(const sp<IBinder>& layerHandle,
+ const sp<IGraphicBufferProducer>& producer,
+ uint32_t rotation) {
+ sp<ISurfaceComposer> s(ComposerService::getComposerService());
+ if (s == NULL) return NO_INIT;
+ return s->captureLayers(layerHandle, producer,
+ static_cast<ISurfaceComposer::Rotation>(rotation));
+}
+
ScreenshotClient::ScreenshotClient()
: mHaveBuffer(false) {
memset(&mBuffer, 0, sizeof(mBuffer));