diff options
| author | 2018-10-12 10:04:44 -0700 | |
|---|---|---|
| committer | 2018-11-09 12:55:25 -0800 | |
| commit | c837b5ecc406f6bf6e5424d48435b56decbd903e (patch) | |
| tree | 05f2aa293b43084bd9d310203c7ac46a9d138a11 /libs/gui/LayerState.cpp | |
| parent | 7a9b6ff7ce374ecf49990ee2496130c75a37f7fd (diff) | |
blast: Send transaction listener from SCC to SF
Send the TransactionCompletedListeners to SurfaceFlinger via transactions.
The listener will be used to send callbacks after a transaction has completed.
Test: Transaction_test
Bug: 80477568
Change-Id: I51d3877f2803a192f95db4dd211f48aca9651c30
Diffstat (limited to 'libs/gui/LayerState.cpp')
| -rw-r--r-- | libs/gui/LayerState.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index 2b0a46181b..7b71b39ce0 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -80,6 +80,13 @@ status_t layer_state_t::write(Parcel& output) const memcpy(output.writeInplace(16 * sizeof(float)), colorTransform.asArray(), 16 * sizeof(float)); + if (output.writeVectorSize(listenerCallbacks) == NO_ERROR) { + for (const auto& [listener, callbackIds] : listenerCallbacks) { + output.writeStrongBinder(IInterface::asBinder(listener)); + output.writeInt64Vector(callbackIds); + } + } + return NO_ERROR; } @@ -135,6 +142,14 @@ status_t layer_state_t::read(const Parcel& input) colorTransform = mat4(static_cast<const float*>(input.readInplace(16 * sizeof(float)))); + int32_t listenersSize = input.readInt32(); + for (int32_t i = 0; i < listenersSize; i++) { + auto listener = interface_cast<ITransactionCompletedListener>(input.readStrongBinder()); + std::vector<CallbackId> callbackIds; + input.readInt64Vector(&callbackIds); + listenerCallbacks.emplace_back(listener, callbackIds); + } + return NO_ERROR; } @@ -323,6 +338,10 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eColorTransformChanged; colorTransform = other.colorTransform; } + if (other.what & eListenerCallbacksChanged) { + what |= eListenerCallbacksChanged; + listenerCallbacks = other.listenerCallbacks; + } if ((other.what & what) != other.what) { ALOGE("Unmerged SurfaceComposer Transaction properties. LayerState::merge needs updating? " |