diff options
| author | 2014-02-20 00:56:34 +0000 | |
|---|---|---|
| committer | 2014-02-20 00:56:34 +0000 | |
| commit | da03fe4bfcc5f6626d38798e4d9def8596fd869c (patch) | |
| tree | 560ea71efc14b19d598d2984bea738646a9a7a3e /libs/gui | |
| parent | 79aa621330e1fefcfc7ccf7c14ef51a8d0ea8c9c (diff) | |
| parent | c701401f8cec2e5309f8b57e2b97baced5093274 (diff) | |
Merge "Allow disabling layer rotation during screenshots"
Diffstat (limited to 'libs/gui')
| -rw-r--r-- | libs/gui/ISurfaceComposer.cpp | 9 | ||||
| -rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 20 |
2 files changed, 19 insertions, 10 deletions
diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp index aab06047a4..e96cc54c7e 100644 --- a/libs/gui/ISurfaceComposer.cpp +++ b/libs/gui/ISurfaceComposer.cpp @@ -105,7 +105,8 @@ public: virtual status_t captureScreen(const sp<IBinder>& display, const sp<IGraphicBufferProducer>& producer, uint32_t reqWidth, uint32_t reqHeight, - uint32_t minLayerZ, uint32_t maxLayerZ) + uint32_t minLayerZ, uint32_t maxLayerZ, + bool useIdentityTransform) { Parcel data, reply; data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); @@ -115,6 +116,7 @@ public: data.writeInt32(reqHeight); data.writeInt32(minLayerZ); data.writeInt32(maxLayerZ); + data.writeInt32(static_cast<int32_t>(useIdentityTransform)); remote()->transact(BnSurfaceComposer::CAPTURE_SCREEN, data, &reply); return reply.readInt32(); } @@ -285,8 +287,11 @@ status_t BnSurfaceComposer::onTransact( uint32_t reqHeight = data.readInt32(); uint32_t minLayerZ = data.readInt32(); uint32_t maxLayerZ = data.readInt32(); + bool useIdentityTransform = static_cast<bool>(data.readInt32()); + status_t res = captureScreen(display, producer, - reqWidth, reqHeight, minLayerZ, maxLayerZ); + reqWidth, reqHeight, minLayerZ, maxLayerZ, + useIdentityTransform); reply->writeInt32(res); return NO_ERROR; } 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<IBinder>& display, const sp<IGraphicBufferProducer>& producer, uint32_t reqWidth, uint32_t reqHeight, - uint32_t minLayerZ, uint32_t maxLayerZ) { + uint32_t minLayerZ, uint32_t maxLayerZ, bool useIdentityTransform) { sp<ISurfaceComposer> 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<CpuConsumer> ScreenshotClient::getCpuConsumer() const { status_t ScreenshotClient::update(const sp<IBinder>& display, uint32_t reqWidth, uint32_t reqHeight, - uint32_t minLayerZ, uint32_t maxLayerZ) { + uint32_t minLayerZ, uint32_t maxLayerZ, + bool useIdentityTransform) { sp<ISurfaceComposer> s(ComposerService::getComposerService()); if (s == NULL) return NO_INIT; sp<CpuConsumer> cpuConsumer = getCpuConsumer(); @@ -667,7 +668,7 @@ status_t ScreenshotClient::update(const sp<IBinder>& 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<IBinder>& display, return err; } -status_t ScreenshotClient::update(const sp<IBinder>& display) { - return ScreenshotClient::update(display, 0, 0, 0, -1UL); +status_t ScreenshotClient::update(const sp<IBinder>& display, + bool useIdentityTransform) { + return ScreenshotClient::update(display, 0, 0, 0, -1UL, + useIdentityTransform); } status_t ScreenshotClient::update(const sp<IBinder>& 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() { |