!33316 SetRootRect在主线程同步执行

Merge pull request !33316 from fangzhiyuan/0517_setRoot
This commit is contained in:
openharmony_ci 2024-05-21 01:25:58 +00:00 committed by Gitee
commit f9db9fe409
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 7 additions and 7 deletions

View File

@ -2040,8 +2040,9 @@ void UIContentImpl::UpdateViewportConfig(const ViewportConfig& config, OHOS::Ros
pipelineContext->ChangeDarkModeBrightness(true);
}
};
if (container->IsUseStageModel() && (reason == OHOS::Rosen::WindowSizeChangeReason::ROTATION ||
reason == OHOS::Rosen::WindowSizeChangeReason::UPDATE_DPI_SYNC)) {
if ((container->IsUseStageModel() && (reason == OHOS::Rosen::WindowSizeChangeReason::ROTATION ||
reason == OHOS::Rosen::WindowSizeChangeReason::UPDATE_DPI_SYNC)) ||
taskExecutor->WillRunOnCurrentThread(TaskExecutor::TaskType::PLATFORM)) {
task();
} else {
AceViewportConfig aceViewportConfig(modifyConfig, reason, rsTransaction);

View File

@ -226,15 +226,14 @@ void PipelineBase::SetRootSize(double density, float width, float height)
}
context->SetRootRect(width, height);
};
#ifdef NG_BUILD
if (taskExecutor_->WillRunOnCurrentThread(TaskExecutor::TaskType::UI)) {
auto container = Container::GetContainer(instanceId_);
auto settings = container->GetSettings();
if (settings.usePlatformAsUIThread && settings.useUIAsJSThread) {
task();
} else {
taskExecutor_->PostTask(task, TaskExecutor::TaskType::UI, "ArkUISetRootSize");
}
#else
taskExecutor_->PostTask(task, TaskExecutor::TaskType::UI, "ArkUISetRootSize");
#endif
}
void PipelineBase::SetFontScale(float fontScale)