[Magnifier-26] Wire up frame callback for realsies
Test: none yet Bug: 73810478 Bug: 72041926 Change-Id: I7154ed4b3d2cd820dc8c8ff55eed130be87d1606
This commit is contained in:
@@ -94,12 +94,20 @@ void DrawFrameTask::run() {
|
||||
|
||||
// Grab a copy of everything we need
|
||||
CanvasContext* context = mContext;
|
||||
std::function<void(int64_t)> callback = std::move(mFrameCallback);
|
||||
|
||||
// From this point on anything in "this" is *UNSAFE TO ACCESS*
|
||||
if (canUnblockUiThread) {
|
||||
unblockUiThread();
|
||||
}
|
||||
|
||||
// Even if we aren't drawing this vsync pulse the next frame number will still be accurate
|
||||
if (CC_UNLIKELY(callback)) {
|
||||
context->enqueueFrameWork([callback, frameNr = context->getFrameNumber()]() {
|
||||
callback(frameNr);
|
||||
});
|
||||
}
|
||||
|
||||
if (CC_LIKELY(canDrawThisFrame)) {
|
||||
context->draw();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user