Loading libs/gui/SurfaceComposerClient.cpp +15 −12 Original line number Diff line number Diff line Loading @@ -982,14 +982,16 @@ void SurfaceComposerClient::Transaction::cacheBuffers() { class SyncCallback { public: static void function(void* callbackContext, nsecs_t /* latchTime */, static auto getCallback(std::shared_ptr<SyncCallback>& callbackContext) { return [callbackContext](void* /* unused context */, nsecs_t /* latchTime */, const sp<Fence>& /* presentFence */, const std::vector<SurfaceControlStats>& /* stats */) { if (!callbackContext) { ALOGE("failed to get callback context for SyncCallback"); return; } SyncCallback* helper = static_cast<SyncCallback*>(callbackContext); LOG_ALWAYS_FATAL_IF(sem_post(&helper->mSemaphore), "sem_post failed"); LOG_ALWAYS_FATAL_IF(sem_post(&callbackContext->mSemaphore), "sem_post failed"); }; } ~SyncCallback() { if (mInitialized) { Loading Loading @@ -1024,10 +1026,11 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay return mStatus; } SyncCallback syncCallback; std::shared_ptr<SyncCallback> syncCallback = std::make_shared<SyncCallback>(); if (synchronous) { syncCallback.init(); addTransactionCommittedCallback(syncCallback.function, syncCallback.getContext()); syncCallback->init(); addTransactionCommittedCallback(SyncCallback::getCallback(syncCallback), /*callbackContext=*/nullptr); } bool hasListenerCallbacks = !mListenerCallbacks.empty(); Loading Loading @@ -1103,7 +1106,7 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay clear(); if (synchronous) { syncCallback.wait(); syncCallback->wait(); } mStatus = NO_ERROR; Loading Loading
libs/gui/SurfaceComposerClient.cpp +15 −12 Original line number Diff line number Diff line Loading @@ -982,14 +982,16 @@ void SurfaceComposerClient::Transaction::cacheBuffers() { class SyncCallback { public: static void function(void* callbackContext, nsecs_t /* latchTime */, static auto getCallback(std::shared_ptr<SyncCallback>& callbackContext) { return [callbackContext](void* /* unused context */, nsecs_t /* latchTime */, const sp<Fence>& /* presentFence */, const std::vector<SurfaceControlStats>& /* stats */) { if (!callbackContext) { ALOGE("failed to get callback context for SyncCallback"); return; } SyncCallback* helper = static_cast<SyncCallback*>(callbackContext); LOG_ALWAYS_FATAL_IF(sem_post(&helper->mSemaphore), "sem_post failed"); LOG_ALWAYS_FATAL_IF(sem_post(&callbackContext->mSemaphore), "sem_post failed"); }; } ~SyncCallback() { if (mInitialized) { Loading Loading @@ -1024,10 +1026,11 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay return mStatus; } SyncCallback syncCallback; std::shared_ptr<SyncCallback> syncCallback = std::make_shared<SyncCallback>(); if (synchronous) { syncCallback.init(); addTransactionCommittedCallback(syncCallback.function, syncCallback.getContext()); syncCallback->init(); addTransactionCommittedCallback(SyncCallback::getCallback(syncCallback), /*callbackContext=*/nullptr); } bool hasListenerCallbacks = !mListenerCallbacks.empty(); Loading Loading @@ -1103,7 +1106,7 @@ status_t SurfaceComposerClient::Transaction::apply(bool synchronous, bool oneWay clear(); if (synchronous) { syncCallback.wait(); syncCallback->wait(); } mStatus = NO_ERROR; Loading