struct CallbackTranslation {
TransactionCompletedCallback callbackFunction;
std::unordered_map<sp<IBinder>, sp<SurfaceControl>, SurfaceComposerClient::IBinderHash>
surfaceControls;
};
TransactionCompletedCallback 是一个函数指针类型。
using TransactionCompletedCallback =
std::function<void(nsecs_t /*latchTime*/, const sp<Fence>& /*presentFence*/,
const std::vector<SurfaceControlStats>& /*stats*/)>;
surfaceControls
的 key 是 SurfaceControl::mHandle
。
CallbackTranslation 作为 TransactionCompletedListener::mCallbacks
的 value 类型,key 是 CallbackId。
std::unordered_map<CallbackId, CallbackTranslation, CallbackIdHash> mCallbacks
GUARDED_BY(mMutex);