diff options
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 |
commit | c18790018be5d7ea7061ccbc81f3044e74adc823 (patch) | |
tree | d03920775e72b284447202d109996002ce5e1784 /include | |
parent | 9bf29a81df0eaf923f3a9821655c663290a0a854 (diff) | |
download | frameworks_native-c18790018be5d7ea7061ccbc81f3044e74adc823.zip frameworks_native-c18790018be5d7ea7061ccbc81f3044e74adc823.tar.gz frameworks_native-c18790018be5d7ea7061ccbc81f3044e74adc823.tar.bz2 |
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 'include')
-rw-r--r-- | include/gui/ISurfaceComposer.h | 4 | ||||
-rw-r--r-- | include/gui/SurfaceComposerClient.h | 15 |
2 files changed, 12 insertions, 7 deletions
diff --git a/include/gui/ISurfaceComposer.h b/include/gui/ISurfaceComposer.h index 8042211..1581084 100644 --- a/include/gui/ISurfaceComposer.h +++ b/include/gui/ISurfaceComposer.h @@ -41,6 +41,7 @@ class DisplayState; class DisplayInfo; class IDisplayEventConnection; class IMemoryHeap; +class Rect; /* * This class defines the Binder IPC interface for accessing various @@ -131,11 +132,10 @@ public: */ virtual status_t captureScreen(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) = 0; - /* Clears the frame statistics for animations. * * Requires the ACCESS_SURFACE_FLINGER permission. diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h index c2192af..e666329 100644 --- a/include/gui/SurfaceComposerClient.h +++ b/include/gui/SurfaceComposerClient.h @@ -180,10 +180,12 @@ private: class ScreenshotClient { public: + // if cropping isn't required, callers may pass in a default Rect, e.g.: + // capture(display, producer, Rect(), reqWidth, ...); static status_t 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); @@ -197,13 +199,16 @@ public: ScreenshotClient(); ~ScreenshotClient(); - // frees the previous screenshot and capture a new one - status_t update(const sp<IBinder>& display, bool useIdentityTransform); + // frees the previous screenshot and captures a new one + // if cropping isn't required, callers may pass in a default Rect, e.g.: + // update(display, Rect(), useIdentityTransform); status_t update(const sp<IBinder>& display, - uint32_t reqWidth, uint32_t reqHeight, + Rect sourceCrop, bool useIdentityTransform); + status_t update(const sp<IBinder>& display, + Rect sourceCrop, uint32_t reqWidth, uint32_t reqHeight, bool useIdentityTransform); status_t 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); |