diff options
| author | 2023-02-26 03:24:58 +0000 | |
|---|---|---|
| committer | 2023-02-27 16:58:52 +0000 | |
| commit | a7caedcbabb35443a7d7c0d0ef4aef6fa8f5af8e (patch) | |
| tree | bacbc7e1a46df4c29a7c3c985521a99a41eb2243 /services/surfaceflinger/SurfaceFlinger.cpp | |
| parent | fccd6362efb3c58c72ada640b46580af03bcdd76 (diff) | |
[sf] fix boot animation with new frontend
We were dropping the transaction since it was passed via
an internal function and not the transaction queue.
Bug: 238781169
Test: boot animation
Change-Id: I68818430eba08318bc2264d3a4b56150d92b0dc6
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
| -rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index bee89aa3ef..07b2fa153b 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -2268,12 +2268,13 @@ bool SurfaceFlinger::updateLayerSnapshots(VsyncId vsyncId, LifecycleUpdate& upda mLayerLifecycleManager.commitChanges(); } + commitTransactions(); + // enter boot animation on first buffer latch if (CC_UNLIKELY(mBootStage == BootStage::BOOTLOADER && newDataLatched)) { ALOGI("Enter boot animation"); mBootStage = BootStage::BOOTANIMATION; } - commitTransactions(); } mustComposite |= (getTransactionFlags() & ~eTransactionFlushNeeded) || newDataLatched; return mustComposite; @@ -5207,8 +5208,18 @@ void SurfaceFlinger::onInitializeDisplays() { const sp<IBinder> token = display->getDisplayToken().promote(); LOG_ALWAYS_FATAL_IF(token == nullptr); + TransactionState state; + state.inputWindowCommands = mInputWindowCommands; + nsecs_t now = systemTime(); + state.desiredPresentTime = now; + state.postTime = now; + state.permissions = layer_state_t::ACCESS_SURFACE_FLINGER; + state.originPid = mPid; + state.originUid = static_cast<int>(getuid()); + uint64_t transactionId = (((uint64_t)mPid) << 32) | mUniqueTransactionId++; + state.id = transactionId; + // reset screen orientation and use primary layer stack - std::vector<ResolvedComposerState> state; Vector<DisplayState> displays; DisplayState d; d.what = DisplayState::eDisplayProjectionChanged | @@ -5220,15 +5231,17 @@ void SurfaceFlinger::onInitializeDisplays() { d.layerStackSpaceRect.makeInvalid(); d.width = 0; d.height = 0; - displays.add(d); + state.displays.add(d); - nsecs_t now = systemTime(); + std::vector<TransactionState> transactions; + transactions.emplace_back(state); - int64_t transactionId = (((int64_t)mPid) << 32) | mUniqueTransactionId++; // It should be on the main thread, apply it directly. - applyTransactionState(FrameTimelineInfo{}, state, displays, 0, mInputWindowCommands, - /* desiredPresentTime */ now, true, {}, /* postTime */ now, true, false, - {}, mPid, getuid(), transactionId); + if (mLegacyFrontEndEnabled) { + applyTransactionsLocked(transactions, /*vsyncId=*/{0}); + } else { + applyAndCommitDisplayTransactionStates(transactions); + } setPowerModeInternal(display, hal::PowerMode::ON); } |