summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author Dan Stoza <stoza@google.com> 2014-05-22 15:59:05 -0700
committer Dan Stoza <stoza@google.com> 2014-05-23 09:19:03 -0700
commitc18790018be5d7ea7061ccbc81f3044e74adc823 (patch)
treed03920775e72b284447202d109996002ce5e1784 /libs/gui/SurfaceComposerClient.cpp
parent9bf29a81df0eaf923f3a9821655c663290a0a854 (diff)
SurfaceFlinger: Add sourceCrop to screenshot
Adds a sourceCrop Rect parameter to screenshot commands, which allows clients to capture only a portion of the screen instead of the whole screen. Bug: 15137922 Change-Id: I629447573cd34ffb96334cde7ba02490b9ea06d8
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 1dffdb2013..eedeca18d1 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -676,11 +676,11 @@ status_t SurfaceComposerClient::getAnimationFrameStats(FrameStats* outStats) {
status_t ScreenshotClient::capture(
const sp<IBinder>& display,
const sp<IGraphicBufferProducer>& producer,
- uint32_t reqWidth, uint32_t reqHeight,
+ Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight,
uint32_t minLayerZ, uint32_t maxLayerZ, bool useIdentityTransform) {
sp<ISurfaceComposer> s(ComposerService::getComposerService());
if (s == NULL) return NO_INIT;
- return s->captureScreen(display, producer,
+ return s->captureScreen(display, producer, sourceCrop,
reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform);
}
@@ -704,7 +704,7 @@ sp<CpuConsumer> ScreenshotClient::getCpuConsumer() const {
}
status_t ScreenshotClient::update(const sp<IBinder>& display,
- uint32_t reqWidth, uint32_t reqHeight,
+ Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight,
uint32_t minLayerZ, uint32_t maxLayerZ,
bool useIdentityTransform) {
sp<ISurfaceComposer> s(ComposerService::getComposerService());
@@ -717,7 +717,7 @@ status_t ScreenshotClient::update(const sp<IBinder>& display,
mHaveBuffer = false;
}
- status_t err = s->captureScreen(display, mProducer,
+ status_t err = s->captureScreen(display, mProducer, sourceCrop,
reqWidth, reqHeight, minLayerZ, maxLayerZ, useIdentityTransform);
if (err == NO_ERROR) {
@@ -729,16 +729,16 @@ status_t ScreenshotClient::update(const sp<IBinder>& display,
return err;
}
-status_t ScreenshotClient::update(const sp<IBinder>& display,
+status_t ScreenshotClient::update(const sp<IBinder>& display, Rect sourceCrop,
bool useIdentityTransform) {
- return ScreenshotClient::update(display, 0, 0, 0, -1UL,
+ return ScreenshotClient::update(display, sourceCrop, 0, 0, 0, -1UL,
useIdentityTransform);
}
-status_t ScreenshotClient::update(const sp<IBinder>& display,
+status_t ScreenshotClient::update(const sp<IBinder>& display, Rect sourceCrop,
uint32_t reqWidth, uint32_t reqHeight, bool useIdentityTransform) {
- return ScreenshotClient::update(display, reqWidth, reqHeight, 0, -1UL,
- useIdentityTransform);
+ return ScreenshotClient::update(display, sourceCrop, reqWidth, reqHeight,
+ 0, -1UL, useIdentityTransform);
}
void ScreenshotClient::release() {