!12144 修复uni线程不执行任务,导致动画强制rnv失效

Merge pull request !12144 from XUXIAOBO/20240613-2
This commit is contained in:
openharmony_ci 2024-06-14 04:10:59 +00:00 committed by Gitee
commit bfc068d4b5
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 16 additions and 16 deletions

View File

@ -558,13 +558,11 @@ void RSDisplayRenderNodeDrawable::OnDraw(Drawing::Canvas& canvas)
if (uniParam->IsOpDropped() && CheckDisplayNodeSkip(displayNodeSp, params, processor)) {
RSMainThread::Instance()->SetFrameIsRender(false);
RSUniRenderThread::Instance().DvsyncRequestNextVsync();
SetDisplayNodeSkipFlag(*uniParam, true);
return;
}
SetDisplayNodeSkipFlag(*uniParam, false);
RSMainThread::Instance()->SetFrameIsRender(true);
RSUniRenderThread::Instance().DvsyncRequestNextVsync();
bool isHdrOn = params->GetHDRPresent();
RS_LOGD("SetHDRPresent: %{public}d OnDraw", isHdrOn);

View File

@ -327,6 +327,20 @@ RSMainThread::~RSMainThread() noexcept
}
}
void RSMainThread::DvsyncCheckRequestNextVsync()
{
bool needAnimate = false;
if (needRequestNextVsyncAnimate_) {
rsVSyncDistributor_->MarkRSAnimate();
needAnimate = true;
} else {
rsVSyncDistributor_->UnmarkRSAnimate();
}
if (needAnimate || rsVSyncDistributor_->HasPendingUIRNV()) {
RequestNextVSync("animate", timestamp_);
}
}
void RSMainThread::Init()
{
mainLoop_ = [&]() {
@ -346,6 +360,7 @@ void RSMainThread::Init()
WaitUntilUnmarshallingTaskFinished();
ProcessCommand();
Animate(timestamp_);
DvsyncCheckRequestNextVsync();
CollectInfoForHardwareComposer();
RSUifirstManager::Instance().PrepareCurrentFrameEvent();
ProcessHgmFrameRate(timestamp_);

View File

@ -444,6 +444,7 @@ private:
float GetCurrentSteadyTimeMsFloat() const;
void RequestNextVsyncForCachedCommand(std::string& transactionFlags, pid_t pid, uint64_t curIndex);
void UpdateLuminance();
void DvsyncCheckRequestNextVsync();
std::shared_ptr<AppExecFwk::EventRunner> runner_ = nullptr;
std::shared_ptr<AppExecFwk::EventHandler> handler_ = nullptr;

View File

@ -260,7 +260,6 @@ void RSUniRenderThread::Render()
if (RSMainThread::Instance()->GetMarkRenderFlag() == false) {
RSMainThread::Instance()->SetFrameIsRender(true);
DvsyncRequestNextVsync();
}
RSMainThread::Instance()->ResetMarkRenderFlag();
}
@ -619,17 +618,6 @@ void RSUniRenderThread::RenderServiceTreeDump(std::string& dumpString) const
rootNodeDrawable_->DumpDrawableTree(0, dumpString);
}
void RSUniRenderThread::DvsyncRequestNextVsync()
{
if ((renderThreadParams_ && renderThreadParams_->GetRequestNextVsyncFlag()) ||
RSMainThread::Instance()->rsVSyncDistributor_->HasPendingUIRNV()) {
RSMainThread::Instance()->rsVSyncDistributor_->MarkRSAnimate();
RSMainThread::Instance()->RequestNextVSync("animate", renderThreadParams_->GetCurrentTimestamp());
} else {
RSMainThread::Instance()->rsVSyncDistributor_->UnmarkRSAnimate();
}
}
void RSUniRenderThread::UpdateDisplayNodeScreenId()
{
const std::shared_ptr<RSBaseRenderNode> rootNode =

View File

@ -106,8 +106,6 @@ public:
void ReleaseSurface();
void AddToReleaseQueue(std::shared_ptr<Drawing::Surface>&& surface);
void DvsyncRequestNextVsync();
bool IsMainLooping() const
{
return mainLooping_.load();