mirror of
https://github.com/openharmony/windowmanager.git
synced 2026-07-21 12:35:22 -04:00
add first frame callback for ams
Signed-off-by: chyyy0213 <chenhaiying3@huawei.com> Change-Id: I94cf06ff1a5763467ccf3f8b72ea226a6f07936a Signed-off-by: chyyy0213 <chenhaiying3@huawei.com>
This commit is contained in:
@@ -117,6 +117,7 @@ void StartingWindow::HandleClientWindowCreate(sptr<WindowNode>& node, sptr<IWind
|
||||
WLOGFI("Replace surfaceNode, id: %{public}u", node->GetWindowId());
|
||||
node->leashWinSurfaceNode_->RemoveChild(node->startingWinSurfaceNode_);
|
||||
node->leashWinSurfaceNode_->AddChild(node->surfaceNode_, -1);
|
||||
AAFwk::AbilityManagerClient::GetInstance()->CompleteFirstFrameDrawing(node->abilityToken_);
|
||||
RSTransaction::FlushImplicitTransaction();
|
||||
};
|
||||
node->surfaceNode_->SetBufferAvailableCallback(firstFrameCompleteCallback);
|
||||
|
||||
@@ -1690,7 +1690,7 @@ void WindowNodeContainer::SetDisplaySize(DisplayId displayId, uint32_t width, ui
|
||||
return;
|
||||
}
|
||||
displayInfosMap_[displayId]->SetWidth(width);
|
||||
displayInfosMap_[displayId]->SetHeight(width);
|
||||
displayInfosMap_[displayId]->SetHeight(height);
|
||||
displayRectMap_[displayId].width_ = width;
|
||||
displayRectMap_[displayId].height_ = height;
|
||||
layoutPolicy_->UpdateDisplayInfo(displayRectMap_);
|
||||
|
||||
@@ -187,6 +187,13 @@ WMError WindowRoot::SaveWindow(const sptr<WindowNode>& node)
|
||||
if (node->GetWindowToken()) {
|
||||
AddDeathRecipient(node);
|
||||
}
|
||||
// Register FirstFrame Callback to rs, inform ability to get snapshot
|
||||
auto firstFrameCompleteCallback = [node]() {
|
||||
AAFwk::AbilityManagerClient::GetInstance()->CompleteFirstFrameDrawing(node->abilityToken_);
|
||||
};
|
||||
if (node->surfaceNode_ && WindowHelper::IsMainWindow(node->GetWindowType())) {
|
||||
node->surfaceNode_->SetBufferAvailableCallback(firstFrameCompleteCallback);
|
||||
}
|
||||
return WMError::WM_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user