From c701401f8cec2e5309f8b57e2b97baced5093274 Mon Sep 17 00:00:00 2001 From: Dan Stoza Date: Fri, 14 Feb 2014 15:03:43 -0800 Subject: Allow disabling layer rotation during screenshots Add the ability to ignore layers' transformation matrices during screenshot capture, which will allow the window manager to capture unrotated images for recents during the device rotation animation. Bug: 11805195 Change-Id: I854d87bc84ca06ef9a054a454af1c080ee66fbb8 --- libs/gui/SurfaceComposerClient.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'libs/gui/SurfaceComposerClient.cpp') diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 2246f5f9bb..5fe99e8555 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -628,11 +628,11 @@ status_t ScreenshotClient::capture( const sp& display, const sp& producer, uint32_t reqWidth, uint32_t reqHeight, - uint32_t minLayerZ, uint32_t maxLayerZ) { + uint32_t minLayerZ, uint32_t maxLayerZ, bool useIdentityTransform) { sp s(ComposerService::getComposerService()); if (s == NULL) return NO_INIT; return s->captureScreen(display, producer, - reqWidth, reqHeight, minLayerZ, maxLayerZ); + reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform); } ScreenshotClient::ScreenshotClient() @@ -655,7 +655,8 @@ sp ScreenshotClient::getCpuConsumer() const { status_t ScreenshotClient::update(const sp& display, uint32_t reqWidth, uint32_t reqHeight, - uint32_t minLayerZ, uint32_t maxLayerZ) { + uint32_t minLayerZ, uint32_t maxLayerZ, + bool useIdentityTransform) { sp s(ComposerService::getComposerService()); if (s == NULL) return NO_INIT; sp cpuConsumer = getCpuConsumer(); @@ -667,7 +668,7 @@ status_t ScreenshotClient::update(const sp& display, } status_t err = s->captureScreen(display, mBufferQueue, - reqWidth, reqHeight, minLayerZ, maxLayerZ); + reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform); if (err == NO_ERROR) { err = mCpuConsumer->lockNextBuffer(&mBuffer); @@ -678,13 +679,16 @@ status_t ScreenshotClient::update(const sp& display, return err; } -status_t ScreenshotClient::update(const sp& display) { - return ScreenshotClient::update(display, 0, 0, 0, -1UL); +status_t ScreenshotClient::update(const sp& display, + bool useIdentityTransform) { + return ScreenshotClient::update(display, 0, 0, 0, -1UL, + useIdentityTransform); } status_t ScreenshotClient::update(const sp& display, - uint32_t reqWidth, uint32_t reqHeight) { - return ScreenshotClient::update(display, reqWidth, reqHeight, 0, -1UL); + uint32_t reqWidth, uint32_t reqHeight, bool useIdentityTransform) { + return ScreenshotClient::update(display, reqWidth, reqHeight, 0, -1UL, + useIdentityTransform); } void ScreenshotClient::release() { -- cgit v1.2.3-59-g8ed1b