summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/TransactionCallbackInvoker.cpp
diff options
context:
space:
mode:
author Pascal Mütschard <pmuetschard@google.com> 2024-05-24 17:37:13 +0200
committer Pascal Mütschard <pmuetschard@google.com> 2024-06-28 09:25:33 +0000
commitd56514e908eb4b0738a56930a4d9e8e81a545bcf (patch)
treee72239a8c48425dfa3dc90df57ece3d61d08f20e /services/surfaceflinger/TransactionCallbackInvoker.cpp
parent293ea2be993ba617b6c002d41506a0bb989d2a96 (diff)
Jank callback API refactor.
Removes the old work-arounds for missing jank callbacks. Removes the jank data from the transaction completed callback. Adds new function to ISurfaceComposer to register jank listeners. With the new API, jank data is only sent over binder periodically (every ~50 frames) and on a background thread. It is also only tracked for layers where there is a listener registered. Test: manual, libsurfaceflinger_unittest Bug: http://b/336461947 Flag: EXEMPT refactor Change-Id: I3238ce604571832523525cf098832c7352879826
Diffstat (limited to 'services/surfaceflinger/TransactionCallbackInvoker.cpp')
-rw-r--r--services/surfaceflinger/TransactionCallbackInvoker.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/services/surfaceflinger/TransactionCallbackInvoker.cpp b/services/surfaceflinger/TransactionCallbackInvoker.cpp
index 222ae30acb..b9555c04a8 100644
--- a/services/surfaceflinger/TransactionCallbackInvoker.cpp
+++ b/services/surfaceflinger/TransactionCallbackInvoker.cpp
@@ -64,13 +64,12 @@ status_t TransactionCallbackInvoker::addOnCommitCallbackHandles(
if (handles.empty()) {
return NO_ERROR;
}
- const std::vector<JankData>& jankData = std::vector<JankData>();
for (const auto& handle : handles) {
if (!containsOnCommitCallbacks(handle->callbackIds)) {
outRemainingHandles.push_back(handle);
continue;
}
- status_t err = addCallbackHandle(handle, jankData);
+ status_t err = addCallbackHandle(handle);
if (err != NO_ERROR) {
return err;
}
@@ -80,12 +79,12 @@ status_t TransactionCallbackInvoker::addOnCommitCallbackHandles(
}
status_t TransactionCallbackInvoker::addCallbackHandles(
- const std::deque<sp<CallbackHandle>>& handles, const std::vector<JankData>& jankData) {
+ const std::deque<sp<CallbackHandle>>& handles) {
if (handles.empty()) {
return NO_ERROR;
}
for (const auto& handle : handles) {
- status_t err = addCallbackHandle(handle, jankData);
+ status_t err = addCallbackHandle(handle);
if (err != NO_ERROR) {
return err;
}
@@ -111,8 +110,7 @@ status_t TransactionCallbackInvoker::findOrCreateTransactionStats(
return NO_ERROR;
}
-status_t TransactionCallbackInvoker::addCallbackHandle(const sp<CallbackHandle>& handle,
- const std::vector<JankData>& jankData) {
+status_t TransactionCallbackInvoker::addCallbackHandle(const sp<CallbackHandle>& handle) {
// If we can't find the transaction stats something has gone wrong. The client should call
// startRegistration before trying to add a callback handle.
TransactionStats* transactionStats;
@@ -151,8 +149,7 @@ status_t TransactionCallbackInvoker::addCallbackHandle(const sp<CallbackHandle>&
handle->previousReleaseFence,
handle->transformHint,
handle->currentMaxAcquiredBufferCount,
- eventStats, jankData,
- handle->previousReleaseCallbackId);
+ eventStats, handle->previousReleaseCallbackId);
}
return NO_ERROR;
}