!10209 fix GetPixelmap too much

Merge pull request !10209 from hehao/para0419
This commit is contained in:
openharmony_ci 2024-04-21 03:30:27 +00:00 committed by Gitee
commit 7b9e7e61ec
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 9 additions and 0 deletions

View File

@ -1091,6 +1091,9 @@ bool RSRenderServiceConnection::GetPixelmap(NodeId id, const std::shared_ptr<Med
}
mainThread_->PostSyncTask(getPixelmapTask);
} else if (tid == UNI_RENDER_THREAD_INDEX) {
if (!renderThread_.IsIdle()) {
return false;
}
renderThread_.PostSyncTask(getDrawablePixelmapTask);
} else {
RSTaskDispatcher::GetInstance().PostTask(

View File

@ -191,6 +191,11 @@ void RSUniRenderThread::PostSyncTask(const std::function<void()>& task)
handler_->PostSyncTask(task, AppExecFwk::EventQueue::Priority::IMMEDIATE);
}
bool RSUniRenderThread::IsIdle() const
{
return handler_ ? handler_->IsIdle() : false;
}
void RSUniRenderThread::Sync(std::unique_ptr<RSRenderThreadParams>& stagingRenderThreadParams)
{
renderThreadParams_ = std::move(stagingRenderThreadParams);

View File

@ -51,6 +51,7 @@ public:
void PostTask(RSTaskMessage::RSTask task, const std::string& name, int64_t delayTime,
AppExecFwk::EventQueue::Priority priority = AppExecFwk::EventQueue::Priority::HIGH);
void PostSyncTask(const std::function<void()>& task);
bool IsIdle() const;
void Render();
void ReleaseSelfDrawingNodeBuffer();
std::shared_ptr<RSBaseRenderEngine> GetRenderEngine() const;