diff options
author | Rob Carr <racarr@google.com> | 2019-04-05 18:47:40 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-04-05 18:47:40 +0000 |
commit | dee669c2b02fd5be25201f30860658ad490b28d9 (patch) | |
tree | 48963c1a2f370c45dd7144a640bc76b037b85f67 /libs/gui/include | |
parent | 83a199bb919fe8b8fa9b9ebba9d40980bb551069 (diff) | |
parent | 866455f07c21964af5c195709bc2081121965200 (diff) | |
download | android_frameworks_native-dee669c2b02fd5be25201f30860658ad490b28d9.tar.gz android_frameworks_native-dee669c2b02fd5be25201f30860658ad490b28d9.tar.bz2 android_frameworks_native-dee669c2b02fd5be25201f30860658ad490b28d9.zip |
Merge "SurfaceFlinger: Add exclusion list for captureLayers." into qt-dev
Diffstat (limited to 'libs/gui/include')
-rw-r--r-- | libs/gui/include/gui/ISurfaceComposer.h | 19 | ||||
-rw-r--r-- | libs/gui/include/gui/SurfaceComposerClient.h | 11 |
2 files changed, 21 insertions, 9 deletions
diff --git a/libs/gui/include/gui/ISurfaceComposer.h b/libs/gui/include/gui/ISurfaceComposer.h index fe85fdf69..14d92bf04 100644 --- a/libs/gui/include/gui/ISurfaceComposer.h +++ b/libs/gui/include/gui/ISurfaceComposer.h @@ -20,6 +20,7 @@ #include <stdint.h> #include <sys/types.h> +#include <binder/IBinder.h> #include <binder/IInterface.h> #include <gui/ITransactionCompletedListener.h> @@ -37,6 +38,7 @@ #include <utils/Vector.h> #include <optional> +#include <unordered_set> #include <vector> namespace android { @@ -243,6 +245,11 @@ public: sourceCrop, reqWidth, reqHeight, useIdentityTransform, rotation); } + template <class AA> + struct SpHash { + size_t operator()(const sp<AA>& k) const { return std::hash<AA*>()(k.get()); } + }; + /** * Capture a subtree of the layer hierarchy, potentially ignoring the root node. * @@ -250,10 +257,12 @@ public: * of the buffer. The caller should pick the data space and pixel format * that it can consume. */ - virtual status_t captureLayers(const sp<IBinder>& layerHandleBinder, - sp<GraphicBuffer>* outBuffer, const ui::Dataspace reqDataspace, - const ui::PixelFormat reqPixelFormat, const Rect& sourceCrop, - float frameScale = 1.0, bool childrenOnly = false) = 0; + virtual status_t captureLayers( + const sp<IBinder>& layerHandleBinder, sp<GraphicBuffer>* outBuffer, + const ui::Dataspace reqDataspace, const ui::PixelFormat reqPixelFormat, + const Rect& sourceCrop, + const std::unordered_set<sp<IBinder>, SpHash<IBinder>>& excludeHandles, + float frameScale = 1.0, bool childrenOnly = false) = 0; /** * Capture a subtree of the layer hierarchy into an sRGB buffer with RGBA_8888 pixel format, @@ -263,7 +272,7 @@ public: const Rect& sourceCrop, float frameScale = 1.0, bool childrenOnly = false) { return captureLayers(layerHandleBinder, outBuffer, ui::Dataspace::V0_SRGB, - ui::PixelFormat::RGBA_8888, sourceCrop, frameScale, childrenOnly); + ui::PixelFormat::RGBA_8888, sourceCrop, {}, frameScale, childrenOnly); } /* Clears the frame statistics for animations. diff --git a/libs/gui/include/gui/SurfaceComposerClient.h b/libs/gui/include/gui/SurfaceComposerClient.h index 593a5e7d8..f64fb61ec 100644 --- a/libs/gui/include/gui/SurfaceComposerClient.h +++ b/libs/gui/include/gui/SurfaceComposerClient.h @@ -37,6 +37,7 @@ #include <ui/PixelFormat.h> #include <gui/CpuConsumer.h> +#include <gui/ISurfaceComposer.h> #include <gui/ITransactionCompletedListener.h> #include <gui/LayerState.h> #include <gui/SurfaceControl.h> @@ -516,10 +517,12 @@ public: static status_t captureLayers(const sp<IBinder>& layerHandle, const ui::Dataspace reqDataSpace, const ui::PixelFormat reqPixelFormat, Rect sourceCrop, float frameScale, sp<GraphicBuffer>* outBuffer); - static status_t captureChildLayers(const sp<IBinder>& layerHandle, - const ui::Dataspace reqDataSpace, - const ui::PixelFormat reqPixelFormat, Rect sourceCrop, - float frameScale, sp<GraphicBuffer>* outBuffer); + static status_t captureChildLayers( + const sp<IBinder>& layerHandle, const ui::Dataspace reqDataSpace, + const ui::PixelFormat reqPixelFormat, Rect sourceCrop, + const std::unordered_set<sp<IBinder>, ISurfaceComposer::SpHash<IBinder>>& + excludeHandles, + float frameScale, sp<GraphicBuffer>* outBuffer); }; // --------------------------------------------------------------------------- |