summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2013-03-01 13:42:57 -0800
committer Mathias Agopian <mathias@google.com> 2013-03-01 22:53:39 -0800
commit2a9fc493dfdba67108e4335bb1fe931bc1e2a025 (patch)
tree552d2161fb4e8ea2254e1a07210b6e52fa67367f /libs/gui/SurfaceComposerClient.cpp
parenteb0d12963d271052c24abb025d698504df9e7573 (diff)
rework screenshot API and implementation
- SurfaceFlinger now supports to take a screenshot directly into an IGraphicBufferProducer - reimplement the IMemoryHeap screenshot on top of the above - reimplement LayerScreenshot such that its BufferQueue is directly used as the destination of the screenshot. LayerScreenshot is now a thin wrapper around Layer Bug: 6940974 Change-Id: I69a2096b44b91acbb99eba16f83a9c78d94e0d10
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index e8e208f12b..edfa78a35f 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -606,6 +606,17 @@ void SurfaceComposerClient::unblankDisplay(const sp<IBinder>& token) {
// ----------------------------------------------------------------------------
+status_t ScreenshotClient::capture(
+ const sp<IBinder>& display,
+ const sp<IGraphicBufferProducer>& producer,
+ uint32_t reqWidth, uint32_t reqHeight,
+ uint32_t minLayerZ, uint32_t maxLayerZ) {
+ sp<ISurfaceComposer> s(ComposerService::getComposerService());
+ if (s == NULL) return NO_INIT;
+ return s->captureScreen(display, producer,
+ reqWidth, reqHeight, minLayerZ, maxLayerZ);
+}
+
ScreenshotClient::ScreenshotClient()
: mWidth(0), mHeight(0), mFormat(PIXEL_FORMAT_NONE) {
}