From 1088bbf9882d778079eaa7465c1dec2b08848f1a Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Thu, 9 Feb 2023 21:45:08 +0000 Subject: Revert "Cache and uncache buffers in the same transaction" This reverts commit 75ce1ea078444100db9f9eef06a9ef35ad8a0446. Reason for revert: b/266481887 Change-Id: I147947d55672c8f14d9bbe51df54eadfc43edeb2 --- libs/gui/ISurfaceComposer.cpp | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) (limited to 'libs/gui/ISurfaceComposer.cpp') diff --git a/libs/gui/ISurfaceComposer.cpp b/libs/gui/ISurfaceComposer.cpp index cefb9a71d6..a77ca04943 100644 --- a/libs/gui/ISurfaceComposer.cpp +++ b/libs/gui/ISurfaceComposer.cpp @@ -63,8 +63,7 @@ public: Vector& state, const Vector& displays, uint32_t flags, const sp& applyToken, const InputWindowCommands& commands, int64_t desiredPresentTime, - bool isAutoTimestamp, - const std::vector& uncacheBuffers, + bool isAutoTimestamp, const client_cache_t& uncacheBuffer, bool hasListenerCallbacks, const std::vector& listenerCallbacks, uint64_t transactionId) override { @@ -88,11 +87,8 @@ public: SAFE_PARCEL(commands.write, data); SAFE_PARCEL(data.writeInt64, desiredPresentTime); SAFE_PARCEL(data.writeBool, isAutoTimestamp); - SAFE_PARCEL(data.writeUint32, static_cast(uncacheBuffers.size())); - for (const client_cache_t& uncacheBuffer : uncacheBuffers) { - SAFE_PARCEL(data.writeStrongBinder, uncacheBuffer.token.promote()); - SAFE_PARCEL(data.writeUint64, uncacheBuffer.id); - } + SAFE_PARCEL(data.writeStrongBinder, uncacheBuffer.token.promote()); + SAFE_PARCEL(data.writeUint64, uncacheBuffer.id); SAFE_PARCEL(data.writeBool, hasListenerCallbacks); SAFE_PARCEL(data.writeVectorSize, listenerCallbacks); @@ -162,14 +158,11 @@ status_t BnSurfaceComposer::onTransact( SAFE_PARCEL(data.readInt64, &desiredPresentTime); SAFE_PARCEL(data.readBool, &isAutoTimestamp); - SAFE_PARCEL_READ_SIZE(data.readUint32, &count, data.dataSize()); - std::vector uncacheBuffers(count); + client_cache_t uncachedBuffer; sp tmpBinder; - for (size_t i = 0; i < count; i++) { - SAFE_PARCEL(data.readNullableStrongBinder, &tmpBinder); - uncacheBuffers[i].token = tmpBinder; - SAFE_PARCEL(data.readUint64, &uncacheBuffers[i].id); - } + SAFE_PARCEL(data.readNullableStrongBinder, &tmpBinder); + uncachedBuffer.token = tmpBinder; + SAFE_PARCEL(data.readUint64, &uncachedBuffer.id); bool hasListenerCallbacks = false; SAFE_PARCEL(data.readBool, &hasListenerCallbacks); @@ -189,7 +182,7 @@ status_t BnSurfaceComposer::onTransact( return setTransactionState(frameTimelineInfo, state, displays, stateFlags, applyToken, inputWindowCommands, desiredPresentTime, isAutoTimestamp, - uncacheBuffers, hasListenerCallbacks, listenerCallbacks, + uncachedBuffer, hasListenerCallbacks, listenerCallbacks, transactionId); } default: { -- cgit v1.2.3-59-g8ed1b