blob: 92de74a4140bc6e08c3dc7e9d21fa31115093c2e [file] [log] [blame]
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -08001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Mathias Agopian9cce3252010-02-09 17:46:37 -080017#ifndef ANDROID_SF_LAYER_STATE_H
18#define ANDROID_SF_LAYER_STATE_H
chaviw308ddba2020-08-11 16:23:51 -070019
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080020
21#include <stdint.h>
22#include <sys/types.h>
23
Steven Thomas62a4cf82020-01-31 12:04:03 -080024#include <android/native_window.h>
Robert Carr0d480722017-01-10 16:42:54 -080025#include <gui/IGraphicBufferProducer.h>
Valerie Hau9dab9732019-08-20 09:29:25 -070026#include <gui/ITransactionCompletedListener.h>
Peiyong Lind3788632018-09-18 16:01:31 -070027#include <math/mat4.h>
Robert Carr2c358bf2018-08-08 15:58:15 -070028
chaviw3277faf2021-05-19 16:45:23 -050029#include <android/gui/FocusRequest.h>
Robert Carr2c358bf2018-08-08 15:58:15 -070030
chaviw618c42d2020-07-24 15:25:08 -070031#include <gui/ISurfaceComposer.h>
Evan Rosky1f6d6d52018-12-06 10:47:26 -080032#include <gui/LayerMetadata.h>
Pablo Gamito11dcc222020-09-12 15:49:39 +000033#include <gui/SurfaceControl.h>
chaviw3277faf2021-05-19 16:45:23 -050034#include <gui/WindowInfo.h>
chaviw13fdc492017-06-27 12:40:18 -070035#include <math/vec3.h>
Lucas Dupinc3800b82020-10-02 16:24:48 -070036#include <ui/BlurRegion.h>
Marissa Wall61c58622018-07-18 10:12:20 -070037#include <ui/GraphicTypes.h>
Marissa Wall11303242018-07-26 13:36:24 -070038#include <ui/Rect.h>
39#include <ui/Region.h>
Dominik Laskowski718f9602019-11-09 20:01:35 -080040#include <ui/Rotation.h>
John Reckcdb4ed72021-02-04 13:39:33 -050041#include <ui/StretchEffect.h>
Vishnu Nair6213bd92020-05-08 17:42:25 -070042#include <ui/Transform.h>
Steven Thomas62a4cf82020-01-31 12:04:03 -080043#include <utils/Errors.h>
Mathias Agopian9cce3252010-02-09 17:46:37 -080044
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080045namespace android {
46
47class Parcel;
Mathias Agopian698c0872011-06-28 19:09:31 -070048class ISurfaceComposerClient;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080049
Marissa Wall947d34e2019-03-29 14:03:53 -070050struct client_cache_t {
51 wp<IBinder> token = nullptr;
52 uint64_t id;
53
54 bool operator==(const client_cache_t& other) const { return id == other.id; }
55
56 bool isValid() const { return token != nullptr; }
Marissa Wall78b72202019-03-15 14:58:34 -070057};
58
Andy McFadden4125a4f2014-01-29 17:17:11 -080059/*
60 * Used to communicate layer information between SurfaceFlinger and its clients.
61 */
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -080062struct layer_state_t {
Mathias Agopian3165cc22012-08-08 19:42:09 -070063 enum {
chaviwc5676c62020-09-18 15:01:04 -070064 eLayerHidden = 0x01, // SURFACE_HIDDEN in SurfaceControl.java
65 eLayerOpaque = 0x02, // SURFACE_OPAQUE
66 eLayerSkipScreenshot = 0x40, // SKIP_SCREENSHOT
67 eLayerSecure = 0x80, // SECURE
Vishnu Nairf6eddb62021-01-27 22:02:11 -080068 // Queue up BufferStateLayer buffers instead of dropping the oldest buffer when this flag is
69 // set. This blocks the client until all the buffers have been presented. If the buffers
70 // have presentation timestamps, then we may drop buffers.
71 eEnableBackpressure = 0x100, // ENABLE_BACKPRESSURE
Mathias Agopian3165cc22012-08-08 19:42:09 -070072 };
73
74 enum {
Marissa Wall11303242018-07-26 13:36:24 -070075 ePositionChanged = 0x00000001,
76 eLayerChanged = 0x00000002,
77 eSizeChanged = 0x00000004,
78 eAlphaChanged = 0x00000008,
79 eMatrixChanged = 0x00000010,
80 eTransparentRegionChanged = 0x00000020,
81 eFlagsChanged = 0x00000040,
82 eLayerStackChanged = 0x00000080,
Vishnu Nair1506b182021-02-22 14:35:15 -080083 eReleaseBufferListenerChanged = 0x00000400,
Vishnu Nairc97b8db2019-10-29 18:19:35 -070084 eShadowRadiusChanged = 0x00000800,
arthurhungdba591c2021-02-08 17:28:49 +080085 eLayerCreated = 0x00001000,
chaviwf3f40fe2021-04-27 15:54:02 -050086 eBufferCropChanged = 0x00002000,
Vishnu Nairdcce0e22018-08-23 08:35:19 -070087 eRelativeLayerChanged = 0x00004000,
88 eReparent = 0x00008000,
89 eColorChanged = 0x00010000,
90 eDestroySurface = 0x00020000,
91 eTransformChanged = 0x00040000,
92 eTransformToDisplayInverseChanged = 0x00080000,
93 eCropChanged = 0x00100000,
94 eBufferChanged = 0x00200000,
95 eAcquireFenceChanged = 0x00400000,
96 eDataspaceChanged = 0x00800000,
97 eHdrMetadataChanged = 0x01000000,
98 eSurfaceDamageRegionChanged = 0x02000000,
99 eApiChanged = 0x04000000,
100 eSidebandStreamChanged = 0x08000000,
Peiyong Lind3788632018-09-18 16:01:31 -0700101 eColorTransformChanged = 0x10000000,
Marissa Wall3dad52d2019-03-22 14:03:19 -0700102 eHasListenerCallbacksChanged = 0x20000000,
Robert Carr2c358bf2018-08-08 15:58:15 -0700103 eInputInfoChanged = 0x40000000,
Lucas Dupin1b6531c2018-07-05 17:18:21 -0700104 eCornerRadiusChanged = 0x80000000,
Vishnu Nair6bdec7d2021-05-10 15:01:13 -0700105 eDestinationFrameChanged = 0x1'00000000,
Marissa Wallebc2c052019-01-16 19:16:55 -0800106 eCachedBufferChanged = 0x2'00000000,
Valerie Haudd0b7572019-01-29 14:59:27 -0800107 eBackgroundColorChanged = 0x4'00000000,
108 eMetadataChanged = 0x8'00000000,
Peiyong Linc502cb72019-03-01 15:00:23 -0800109 eColorSpaceAgnosticChanged = 0x10'00000000,
Ana Krulecc84d09b2019-11-02 23:10:29 +0100110 eFrameRateSelectionPriority = 0x20'00000000,
Steven Thomas3172e202020-01-06 19:25:30 -0800111 eFrameRateChanged = 0x40'00000000,
Lucas Dupin19c8f0e2019-11-25 17:55:44 -0800112 eBackgroundBlurRadiusChanged = 0x80'00000000,
Valerie Hau871d6352020-01-29 08:44:02 -0800113 eProducerDisconnect = 0x100'00000000,
Vishnu Nair6213bd92020-05-08 17:42:25 -0700114 eFixedTransformHintChanged = 0x200'00000000,
Vishnu Nair6b7c5c92020-09-29 17:27:05 -0700115 eFrameNumberChanged = 0x400'00000000,
Ady Abraham8db10102021-03-15 17:19:23 -0700116 eBlurRegionsChanged = 0x800'00000000,
117 eAutoRefreshChanged = 0x1000'00000000,
118 eStretchChanged = 0x2000'00000000,
Mathias Agopian3165cc22012-08-08 19:42:09 -0700119 };
120
Pablo Gamito11dcc222020-09-12 15:49:39 +0000121 layer_state_t();
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800122
Robert Carr2c5f6d22017-09-26 12:30:35 -0700123 void merge(const layer_state_t& other);
Marissa Wall11303242018-07-26 13:36:24 -0700124 status_t write(Parcel& output) const;
125 status_t read(const Parcel& input);
Vishnu Nairddf9b5c2021-03-29 18:53:41 -0700126 bool hasBufferChanges() const;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800127
Marissa Wall11303242018-07-26 13:36:24 -0700128 struct matrix22_t {
129 float dsdx{0};
130 float dtdx{0};
131 float dtdy{0};
132 float dsdy{0};
chaviw308ddba2020-08-11 16:23:51 -0700133 status_t write(Parcel& output) const;
134 status_t read(const Parcel& input);
Marissa Wall11303242018-07-26 13:36:24 -0700135 };
136 sp<IBinder> surface;
Pablo Gamitodbc31672020-09-01 18:28:58 +0000137 int32_t layerId;
Garfield Tan8a3083e2018-12-03 13:21:07 -0800138 uint64_t what;
Marissa Wall11303242018-07-26 13:36:24 -0700139 float x;
140 float y;
141 int32_t z;
142 uint32_t w;
143 uint32_t h;
144 uint32_t layerStack;
145 float alpha;
Vishnu Nairf6eddb62021-01-27 22:02:11 -0800146 uint32_t flags;
147 uint32_t mask;
Marissa Wall11303242018-07-26 13:36:24 -0700148 uint8_t reserved;
149 matrix22_t matrix;
Lucas Dupin1b6531c2018-07-05 17:18:21 -0700150 float cornerRadius;
Lucas Dupin19c8f0e2019-11-25 17:55:44 -0800151 uint32_t backgroundBlurRadius;
Pablo Gamito11dcc222020-09-12 15:49:39 +0000152 sp<SurfaceControl> reparentSurfaceControl;
Robert Carr0d480722017-01-10 16:42:54 -0800153
Pablo Gamito11dcc222020-09-12 15:49:39 +0000154 sp<SurfaceControl> relativeLayerSurfaceControl;
Robert Carrdb66e622017-04-10 16:55:57 -0700155
Pablo Gamito11dcc222020-09-12 15:49:39 +0000156 sp<SurfaceControl> parentSurfaceControlForChild;
chaviw06178942017-07-27 10:25:59 -0700157
Marissa Wall11303242018-07-26 13:36:24 -0700158 half3 color;
chaviw13fdc492017-06-27 12:40:18 -0700159
Marissa Wall11303242018-07-26 13:36:24 -0700160 // non POD must be last. see write/read
161 Region transparentRegion;
Marissa Wall61c58622018-07-18 10:12:20 -0700162
163 uint32_t transform;
164 bool transformToDisplayInverse;
165 Rect crop;
Marin Shalamanov6ad317c2020-07-29 23:34:07 +0200166 Rect orientedDisplaySpaceRect;
Marissa Wall61c58622018-07-18 10:12:20 -0700167 sp<GraphicBuffer> buffer;
168 sp<Fence> acquireFence;
169 ui::Dataspace dataspace;
170 HdrMetadata hdrMetadata;
171 Region surfaceDamageRegion;
172 int32_t api;
173 sp<NativeHandle> sidebandStream;
Peiyong Lind3788632018-09-18 16:01:31 -0700174 mat4 colorTransform;
Lucas Dupinc3800b82020-10-02 16:24:48 -0700175 std::vector<BlurRegion> blurRegions;
Marissa Wallc837b5e2018-10-12 10:04:44 -0700176
chaviw3277faf2021-05-19 16:45:23 -0500177 sp<gui::WindowInfoHandle> windowInfoHandle = new gui::WindowInfoHandle();
Marissa Wallebc2c052019-01-16 19:16:55 -0800178
Marissa Wall947d34e2019-03-29 14:03:53 -0700179 client_cache_t cachedBuffer;
Valerie Haued54efa2019-01-11 20:03:14 -0800180
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800181 LayerMetadata metadata;
Valerie Haudd0b7572019-01-29 14:59:27 -0800182
183 // The following refer to the alpha, and dataspace, respectively of
184 // the background color layer
185 float bgColorAlpha;
186 ui::Dataspace bgColorDataspace;
Peiyong Linc502cb72019-03-01 15:00:23 -0800187
188 // A color space agnostic layer means the color of this layer can be
189 // interpreted in any color space.
190 bool colorSpaceAgnostic;
Valerie Hau9dab9732019-08-20 09:29:25 -0700191
192 std::vector<ListenerCallbacks> listeners;
Vishnu Nairc97b8db2019-10-29 18:19:35 -0700193
194 // Draws a shadow around the surface.
195 float shadowRadius;
Ana Krulecc84d09b2019-11-02 23:10:29 +0100196
197 // Priority of the layer assigned by Window Manager.
198 int32_t frameRateSelectionPriority;
Steven Thomas3172e202020-01-06 19:25:30 -0800199
Steven Thomas62a4cf82020-01-31 12:04:03 -0800200 // Layer frame rate and compatibility. See ANativeWindow_setFrameRate().
Steven Thomas3172e202020-01-06 19:25:30 -0800201 float frameRate;
Steven Thomas62a4cf82020-01-31 12:04:03 -0800202 int8_t frameRateCompatibility;
Marin Shalamanovc5986772021-03-16 16:09:49 +0100203 int8_t changeFrameRateStrategy;
Vishnu Nair6213bd92020-05-08 17:42:25 -0700204
205 // Set by window manager indicating the layer and all its children are
206 // in a different orientation than the display. The hint suggests that
207 // the graphic producers should receive a transform hint as if the
208 // display was in this orientation. When the display changes to match
209 // the layer orientation, the graphic producer may not need to allocate
210 // a buffer of a different size. -1 means the transform hint is not set,
211 // otherwise the value will be a valid ui::Rotation.
212 ui::Transform::RotationFlags fixedTransformHint;
Vishnu Nair6b7c5c92020-09-29 17:27:05 -0700213
214 // Used by BlastBufferQueue to forward the framenumber generated by the
215 // graphics producer.
216 uint64_t frameNumber;
Robert Carr9b611b72020-10-19 12:00:23 -0700217
Vishnu Naircf26a0a2020-11-13 12:56:20 -0800218 // Indicates that the consumer should acquire the next frame as soon as it
219 // can and not wait for a frame to become available. This is only relevant
220 // in shared buffer mode.
221 bool autoRefresh;
John Reckcdb4ed72021-02-04 13:39:33 -0500222
223 // Stretch effect to be applied to this layer
224 StretchEffect stretchEffect;
Vishnu Nair1506b182021-02-22 14:35:15 -0800225
chaviwf3f40fe2021-04-27 15:54:02 -0500226 Rect bufferCrop;
Vishnu Nair6bdec7d2021-05-10 15:01:13 -0700227 Rect destinationFrame;
chaviwf3f40fe2021-04-27 15:54:02 -0500228
Vishnu Nair1506b182021-02-22 14:35:15 -0800229 // Listens to when the buffer is safe to be released. This is used for blast
230 // layers only. The callback includes a release fence as well as the graphic
231 // buffer id to identify the buffer.
232 sp<ITransactionCompletedListener> releaseBufferListener;
Vishnu Nair4ba0c2e2021-06-24 11:27:17 -0700233
234 // Keeps track of the release callback id associated with the listener. This
235 // is not sent to the server since the id can be reconstructed there. This
236 // is used to remove the old callback from the client process map if it is
237 // overwritten by another setBuffer call.
238 ReleaseCallbackId releaseCallbackId;
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800239};
240
Mathias Agopian698c0872011-06-28 19:09:31 -0700241struct ComposerState {
Mathias Agopian698c0872011-06-28 19:09:31 -0700242 layer_state_t state;
Marissa Wall11303242018-07-26 13:36:24 -0700243 status_t write(Parcel& output) const;
244 status_t read(const Parcel& input);
Mathias Agopian698c0872011-06-28 19:09:31 -0700245};
246
Mathias Agopian8b33f032012-07-24 20:43:54 -0700247struct DisplayState {
Mathias Agopian3165cc22012-08-08 19:42:09 -0700248 enum {
Marissa Wall11303242018-07-26 13:36:24 -0700249 eSurfaceChanged = 0x01,
250 eLayerStackChanged = 0x02,
251 eDisplayProjectionChanged = 0x04,
Evan Rosky2239b372021-05-20 13:43:47 -0700252 eDisplaySizeChanged = 0x08,
253 eFlagsChanged = 0x10
Mathias Agopiane57f2922012-08-09 16:29:12 -0700254 };
255
Pablo Ceballos60d69222015-08-07 14:47:20 -0700256 DisplayState();
Robert Carr2c5f6d22017-09-26 12:30:35 -0700257 void merge(const DisplayState& other);
Pablo Ceballos60d69222015-08-07 14:47:20 -0700258
Mathias Agopiane57f2922012-08-09 16:29:12 -0700259 uint32_t what;
260 sp<IBinder> token;
Andy McFadden2adaf042012-12-18 09:49:45 -0800261 sp<IGraphicBufferProducer> surface;
Mathias Agopiane57f2922012-08-09 16:29:12 -0700262 uint32_t layerStack;
Evan Rosky2239b372021-05-20 13:43:47 -0700263 uint32_t flags;
Chia-I Wuff79ef82018-08-22 15:27:32 -0700264
265 // These states define how layers are projected onto the physical display.
266 //
Marin Shalamanov6ad317c2020-07-29 23:34:07 +0200267 // Layers are first clipped to `layerStackSpaceRect'. They are then translated and
268 // scaled from `layerStackSpaceRect' to `orientedDisplaySpaceRect'. Finally, they are rotated
269 // according to `orientation', `width', and `height'.
Chia-I Wuff79ef82018-08-22 15:27:32 -0700270 //
Marin Shalamanov6ad317c2020-07-29 23:34:07 +0200271 // For example, assume layerStackSpaceRect is Rect(0, 0, 200, 100), orientedDisplaySpaceRect is
272 // Rect(20, 10, 420, 210), and the size of the display is WxH. When orientation is 0, layers
273 // will be scaled by a factor of 2 and translated by (20, 10). When orientation is 1, layers
274 // will be additionally rotated by 90 degrees around the origin clockwise and translated by (W,
275 // 0).
Dominik Laskowski718f9602019-11-09 20:01:35 -0800276 ui::Rotation orientation = ui::ROTATION_0;
Marin Shalamanov6ad317c2020-07-29 23:34:07 +0200277 Rect layerStackSpaceRect;
278 Rect orientedDisplaySpaceRect;
Chia-I Wuff79ef82018-08-22 15:27:32 -0700279
Michael Wright1f6078a2014-06-26 16:01:02 -0700280 uint32_t width, height;
Chia-I Wuff79ef82018-08-22 15:27:32 -0700281
Mathias Agopiane57f2922012-08-09 16:29:12 -0700282 status_t write(Parcel& output) const;
283 status_t read(const Parcel& input);
Mathias Agopian8b33f032012-07-24 20:43:54 -0700284};
285
chaviw273171b2018-12-26 11:46:30 -0800286struct InputWindowCommands {
chaviw3277faf2021-05-19 16:45:23 -0500287 std::vector<gui::FocusRequest> focusRequests;
chaviw291d88a2019-02-14 10:33:58 -0800288 bool syncInputWindows{false};
chaviw273171b2018-12-26 11:46:30 -0800289
Vishnu Naire798b472020-07-23 13:52:21 -0700290 // Merges the passed in commands and returns true if there were any changes.
291 bool merge(const InputWindowCommands& other);
Vishnu Nair958da932020-08-21 17:12:37 -0700292 bool empty() const;
chaviw273171b2018-12-26 11:46:30 -0800293 void clear();
chaviw308ddba2020-08-11 16:23:51 -0700294 status_t write(Parcel& output) const;
295 status_t read(const Parcel& input);
chaviw273171b2018-12-26 11:46:30 -0800296};
297
Marissa Wall11303242018-07-26 13:36:24 -0700298static inline int compare_type(const ComposerState& lhs, const ComposerState& rhs) {
Marissa Wall11303242018-07-26 13:36:24 -0700299 if (lhs.state.surface < rhs.state.surface) return -1;
300 if (lhs.state.surface > rhs.state.surface) return 1;
Robert Carr4cdc58f2017-08-23 14:22:20 -0700301 return 0;
302}
303
Marissa Wall11303242018-07-26 13:36:24 -0700304static inline int compare_type(const DisplayState& lhs, const DisplayState& rhs) {
Robert Carr4cdc58f2017-08-23 14:22:20 -0700305 return compare_type(lhs.token, rhs.token);
306}
307
Ady Abrahamdd5bfa92021-01-07 17:56:08 -0800308// Returns true if the frameRate is valid.
309//
310// @param frameRate the frame rate in Hz
311// @param compatibility a ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_*
Marin Shalamanovc5986772021-03-16 16:09:49 +0100312// @param changeFrameRateStrategy a ANATIVEWINDOW_CHANGE_FRAME_RATE_*
Ady Abrahamdd5bfa92021-01-07 17:56:08 -0800313// @param functionName calling function or nullptr. Used for logging
314// @param privileged whether caller has unscoped surfaceflinger access
Marin Shalamanovc5986772021-03-16 16:09:49 +0100315bool ValidateFrameRate(float frameRate, int8_t compatibility, int8_t changeFrameRateStrategy,
316 const char* functionName, bool privileged = false);
Steven Thomas62a4cf82020-01-31 12:04:03 -0800317
chaviw618c42d2020-07-24 15:25:08 -0700318struct CaptureArgs {
chaviw4b9d5e12020-08-04 18:30:35 -0700319 const static int32_t UNSET_UID = -1;
chaviw618c42d2020-07-24 15:25:08 -0700320 virtual ~CaptureArgs() = default;
321
322 ui::PixelFormat pixelFormat{ui::PixelFormat::RGBA_8888};
323 Rect sourceCrop;
chaviw17ac24b2021-01-28 18:50:05 -0800324 float frameScaleX{1};
325 float frameScaleY{1};
chaviw618c42d2020-07-24 15:25:08 -0700326 bool captureSecureLayers{false};
chaviw4b9d5e12020-08-04 18:30:35 -0700327 int32_t uid{UNSET_UID};
Peiyong Lincd261472020-10-06 18:05:25 -0700328 // Force capture to be in a color space. If the value is ui::Dataspace::UNKNOWN, the captured
329 // result will be in the display's colorspace.
arthurhung79e81aa2020-08-28 00:09:19 +0800330 // The display may use non-RGB dataspace (ex. displayP3) that could cause pixel data could be
Peiyong Lincd261472020-10-06 18:05:25 -0700331 // different from SRGB (byte per color), and failed when checking colors in tests.
332 // NOTE: In normal cases, we want the screen to be captured in display's colorspace.
333 ui::Dataspace dataspace = ui::Dataspace::UNKNOWN;
chaviw618c42d2020-07-24 15:25:08 -0700334
Peiyong Lin05cc0112020-10-14 16:16:37 -0700335 // The receiver of the capture can handle protected buffer. A protected buffer has
336 // GRALLOC_USAGE_PROTECTED usage bit and must not be accessed unprotected behaviour.
337 // Any read/write access from unprotected context will result in undefined behaviour.
338 // Protected contents are typically DRM contents. This has no direct implication to the
339 // secure property of the surface, which is specified by the application explicitly to avoid
340 // the contents being accessed/captured by screenshot or unsecure display.
341 bool allowProtected = false;
342
chaviw17ac24b2021-01-28 18:50:05 -0800343 bool grayscale = false;
344
chaviw618c42d2020-07-24 15:25:08 -0700345 virtual status_t write(Parcel& output) const;
346 virtual status_t read(const Parcel& input);
347};
348
349struct DisplayCaptureArgs : CaptureArgs {
350 sp<IBinder> displayToken;
351 uint32_t width{0};
352 uint32_t height{0};
353 bool useIdentityTransform{false};
chaviw618c42d2020-07-24 15:25:08 -0700354
355 status_t write(Parcel& output) const override;
356 status_t read(const Parcel& input) override;
357};
358
359struct LayerCaptureArgs : CaptureArgs {
360 sp<IBinder> layerHandle;
361 std::unordered_set<sp<IBinder>, ISurfaceComposer::SpHash<IBinder>> excludeHandles;
chaviw70cb6a42020-07-30 13:57:36 -0700362 bool childrenOnly{false};
chaviw618c42d2020-07-24 15:25:08 -0700363
364 status_t write(Parcel& output) const override;
365 status_t read(const Parcel& input) override;
366};
367
The Android Open Source Projectedbf3b62009-03-03 19:31:44 -0800368}; // namespace android
369
Mathias Agopian9cce3252010-02-09 17:46:37 -0800370#endif // ANDROID_SF_LAYER_STATE_H