!15658 修复HWC中扩展屏的bug

Merge pull request !15658 from Klein-CK/graphic_2d_1005
This commit is contained in:
openharmony_ci 2024-10-05 11:30:52 +00:00 committed by Gitee
commit 5c8eb178d4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1597,7 +1597,8 @@ void RSMainThread::CheckIfHardwareForcedDisabled()
// check all children of global root node, and only disable hardware composer
// in case node's composite type is UNI_RENDER_EXPAND_COMPOSITE or Wired projection
const auto& children = rootNode->GetChildren();
auto itr = std::find_if(children->begin(), children->end(), [](const std::shared_ptr<RSRenderNode>& child) -> bool {
auto itr = std::find_if(children->begin(), children->end(),
[deviceType = deviceType_](const std::shared_ptr<RSRenderNode>& child) -> bool {
if (child == nullptr) {
return false;
}
@ -1609,7 +1610,18 @@ void RSMainThread::CheckIfHardwareForcedDisabled()
// wired projection case
return displayNodeSp->GetCompositeType() == RSDisplayRenderNode::CompositeType::UNI_RENDER_COMPOSITE;
}
return displayNodeSp->GetCompositeType() == RSDisplayRenderNode::CompositeType::UNI_RENDER_EXPAND_COMPOSITE;
if (deviceType != DeviceType::PC) {
return displayNodeSp->GetCompositeType() ==
RSDisplayRenderNode::CompositeType::UNI_RENDER_EXPAND_COMPOSITE;
}
auto screenManager = CreateOrGetScreenManager();
if (!screenManager) {
return false;
}
RSScreenType screenType;
screenManager->GetScreenType(displayNodeSp->GetScreenId(), screenType);
// For PC expand physical screen.
return displayNodeSp->GetScreenId() != 0 && screenType != RSScreenType::VIRTUAL_TYPE_SCREEN;
});
bool isExpandScreenOrWiredProjectionCase = itr != children->end();