mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-27 09:10:54 +00:00
!12144 修复uni线程不执行任务,导致动画强制rnv失效
Merge pull request !12144 from XUXIAOBO/20240613-2
This commit is contained in:
commit
bfc068d4b5
@ -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);
|
||||
|
@ -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_);
|
||||
|
@ -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;
|
||||
|
@ -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 =
|
||||
|
@ -106,8 +106,6 @@ public:
|
||||
void ReleaseSurface();
|
||||
void AddToReleaseQueue(std::shared_ptr<Drawing::Surface>&& surface);
|
||||
|
||||
void DvsyncRequestNextVsync();
|
||||
|
||||
bool IsMainLooping() const
|
||||
{
|
||||
return mainLooping_.load();
|
||||
|
Loading…
Reference in New Issue
Block a user