mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2025-02-17 09:13:19 +00:00
!43616 记录不可取消任务的config
Merge pull request !43616 from Far/updatepromisetask
This commit is contained in:
commit
a5fe84fb13
@ -2527,7 +2527,8 @@ void UIContentImpl::UpdateViewportConfigWithAnimation(const ViewportConfig& conf
|
||||
} else if (rsTransaction != nullptr || isAvoidAreaDoChanged) {
|
||||
// When rsTransaction is not nullptr, the task contains animation. It shouldn't be cancled.
|
||||
// When avoidAreas need updating, the task shouldn't be cancelled.
|
||||
taskExecutor->PostTask(std::move(task), TaskExecutor::TaskType::PLATFORM, "ArkUIUpdateViewportConfig");
|
||||
viewportConfigMgr_->UpdatePromiseConfig(aceViewportConfig, std::move(task), container,
|
||||
"ArkUIPromiseViewportConfig");
|
||||
} else {
|
||||
viewportConfigMgr_->UpdateConfig(aceViewportConfig, std::move(task), container, "ArkUIUpdateViewportConfig");
|
||||
}
|
||||
|
@ -47,6 +47,18 @@ public:
|
||||
task();
|
||||
}
|
||||
|
||||
void UpdatePromiseConfig(const T& config, std::function<void()> &&task, const RefPtr<Container>& container,
|
||||
const std::string& taskName, TaskExecutor::TaskType type = TaskExecutor::TaskType::PLATFORM)
|
||||
{
|
||||
std::lock_guard<std::mutex> taskLock(updateTaskMutex_);
|
||||
CancelUselessTaskLocked();
|
||||
currentTask_.target = config;
|
||||
|
||||
auto taskExecutor = container->GetTaskExecutor();
|
||||
CHECK_NULL_VOID(taskExecutor);
|
||||
taskExecutor->PostTask(std::move(task), type, taskName);
|
||||
}
|
||||
|
||||
void UpdateConfig(const T& config, std::function<void()> &&task, const RefPtr<Container>& container,
|
||||
const std::string& taskName, TaskExecutor::TaskType type = TaskExecutor::TaskType::PLATFORM)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user