mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2025-01-08 09:53:20 +00:00
add: add PreLayout for window to flush first frame
Signed-off-by: yhpeng <pengyuhao1@huawei.com>
This commit is contained in:
parent
ecbf13ff89
commit
10408a6043
@ -3221,4 +3221,21 @@ void UIContentImpl::SetContentNodeGrayScale(float grayscale)
|
||||
CHECK_NULL_VOID(renderContext);
|
||||
renderContext->UpdateFrontGrayScale(Dimension(grayscale));
|
||||
}
|
||||
|
||||
void UIContentImpl::PreLayout()
|
||||
{
|
||||
auto container = Platform::AceContainer::GetContainer(instanceId_);
|
||||
CHECK_NULL_VOID(container);
|
||||
ContainerScope scope(instanceId_);
|
||||
auto pipelineContext = AceType::DynamicCast<NG::PipelineContext>(container->GetPipelineContext());
|
||||
CHECK_NULL_VOID(pipelineContext);
|
||||
auto taskExecutor = container->GetTaskExecutor();
|
||||
CHECK_NULL_VOID(taskExecutor);
|
||||
taskExecutor->PostSyncTask(
|
||||
[pipelineContext] {
|
||||
pipelineContext->PreLayout(pipelineContext->GetTimeFromExternalTimer());
|
||||
},
|
||||
TaskExecutor::TaskType::UI, "ArkUIPreLayout");
|
||||
}
|
||||
|
||||
} // namespace OHOS::Ace
|
||||
|
@ -313,6 +313,8 @@ public:
|
||||
|
||||
void SetContentNodeGrayScale(float grayscale) override;
|
||||
|
||||
void PreLayout() override;
|
||||
|
||||
private:
|
||||
UIContentErrorCode InitializeInner(
|
||||
OHOS::Rosen::Window* window, const std::string& contentInfo, napi_value storage, bool isNamedRouter);
|
||||
|
@ -145,6 +145,8 @@ public:
|
||||
|
||||
void SetContentNodeGrayScale(float grayscale) override {};
|
||||
|
||||
void PreLayout() override {};
|
||||
|
||||
private:
|
||||
UIContentErrorCode CommonInitialize(OHOS::Rosen::Window* window, const std::string& contentInfo,
|
||||
napi_value storage);
|
||||
|
@ -3649,6 +3649,11 @@ bool PipelineContext::IsContainerModalVisible()
|
||||
return isShowTitle_ && isFloatingWindow && customTitleSettedShow_;
|
||||
}
|
||||
|
||||
void PipelineContext::PreLayout(uint64_t nanoTimestamp, uint32_t frameCount)
|
||||
{
|
||||
FlushVsync(nanoTimestamp, frameCount);
|
||||
}
|
||||
|
||||
void PipelineContext::CheckAndLogLastReceivedTouchEventInfo(int32_t eventId, TouchType type)
|
||||
{
|
||||
eventManager_->CheckAndLogLastReceivedTouchEventInfo(eventId, type);
|
||||
|
@ -763,6 +763,9 @@ public:
|
||||
{
|
||||
predictNode_.Reset();
|
||||
}
|
||||
|
||||
void PreLayout(uint64_t nanoTimestamp, uint32_t frameCount);
|
||||
|
||||
protected:
|
||||
void StartWindowSizeChangeAnimate(int32_t width, int32_t height, WindowSizeChangeReason type,
|
||||
const std::shared_ptr<Rosen::RSTransaction>& rsTransaction = nullptr);
|
||||
|
@ -410,6 +410,8 @@ public:
|
||||
const std::function<void(std::vector<Ace::RectF>)>& callback) const {};
|
||||
|
||||
virtual void SetContentNodeGrayScale(float grayscale) {};
|
||||
|
||||
virtual void PreLayout() {};
|
||||
};
|
||||
|
||||
} // namespace OHOS::Ace
|
||||
|
@ -606,6 +606,9 @@ void PipelineContext::CheckAndLogLastConsumedMouseEventInfo(int32_t eventId, Mou
|
||||
void PipelineContext::CheckAndLogLastReceivedAxisEventInfo(int32_t eventId, AxisAction action) {}
|
||||
|
||||
void PipelineContext::CheckAndLogLastConsumedAxisEventInfo(int32_t eventId, AxisAction action) {}
|
||||
|
||||
void PipelineContext::PreLayout(uint64_t nanoTimestamp, uint32_t frameCount) {}
|
||||
|
||||
} // namespace OHOS::Ace::NG
|
||||
// pipeline_context ============================================================
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user