summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2023-04-04 00:25:56 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-04-04 00:25:56 +0000
commit40a0171d4da8607b007f285c2fb5d9dcd3ea496e (patch)
tree86fec72f6ae78470696679608f29409041a03500 /libs/gui/LayerState.cpp
parentc9c2647423d67c21bc971748361218c9c88e4702 (diff)
parent0284463f01bad248b39fce18b44a62551c91a070 (diff)
Merge "Move exclude layer to CaptureArgs." into udc-dev
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index 196949682d..fee91a40c2 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -897,6 +897,11 @@ status_t CaptureArgs::writeToParcel(Parcel* output) const {
SAFE_PARCEL(output->writeInt32, static_cast<int32_t>(dataspace));
SAFE_PARCEL(output->writeBool, allowProtected);
SAFE_PARCEL(output->writeBool, grayscale);
+
+ SAFE_PARCEL(output->writeInt32, excludeHandles.size());
+ for (auto& excludeHandle : excludeHandles) {
+ SAFE_PARCEL(output->writeStrongBinder, excludeHandle);
+ }
return NO_ERROR;
}
@@ -913,6 +918,15 @@ status_t CaptureArgs::readFromParcel(const Parcel* input) {
dataspace = static_cast<ui::Dataspace>(value);
SAFE_PARCEL(input->readBool, &allowProtected);
SAFE_PARCEL(input->readBool, &grayscale);
+
+ int32_t numExcludeHandles = 0;
+ SAFE_PARCEL_READ_SIZE(input->readInt32, &numExcludeHandles, input->dataSize());
+ excludeHandles.reserve(numExcludeHandles);
+ for (int i = 0; i < numExcludeHandles; i++) {
+ sp<IBinder> binder;
+ SAFE_PARCEL(input->readStrongBinder, &binder);
+ excludeHandles.emplace(binder);
+ }
return NO_ERROR;
}
@@ -940,10 +954,6 @@ status_t LayerCaptureArgs::writeToParcel(Parcel* output) const {
SAFE_PARCEL(CaptureArgs::writeToParcel, output);
SAFE_PARCEL(output->writeStrongBinder, layerHandle);
- SAFE_PARCEL(output->writeInt32, excludeHandles.size());
- for (auto el : excludeHandles) {
- SAFE_PARCEL(output->writeStrongBinder, el);
- }
SAFE_PARCEL(output->writeBool, childrenOnly);
return NO_ERROR;
}
@@ -953,15 +963,6 @@ status_t LayerCaptureArgs::readFromParcel(const Parcel* input) {
SAFE_PARCEL(input->readStrongBinder, &layerHandle);
- int32_t numExcludeHandles = 0;
- SAFE_PARCEL_READ_SIZE(input->readInt32, &numExcludeHandles, input->dataSize());
- excludeHandles.reserve(numExcludeHandles);
- for (int i = 0; i < numExcludeHandles; i++) {
- sp<IBinder> binder;
- SAFE_PARCEL(input->readStrongBinder, &binder);
- excludeHandles.emplace(binder);
- }
-
SAFE_PARCEL(input->readBool, &childrenOnly);
return NO_ERROR;
}