Add semantic pixel asserts for lighting scenes

This commit is contained in:
2026-04-05 16:46:47 +08:00
parent cda4a57756
commit 54a699aa26
11 changed files with 282 additions and 96 deletions

View File

@@ -13,7 +13,6 @@ constexpr std::size_t ToIndex(XCUIShellPanelId panelId) {
constexpr std::string_view kViewMenuLabel = "View";
constexpr std::string_view kXCUIDemoShortcut = "Ctrl+1";
constexpr std::string_view kXCUILayoutLabShortcut = "Ctrl+2";
constexpr std::string_view kLegacyHostDemoShortcut = "Ctrl+3";
constexpr std::string_view kNativeBackdropShortcut = "Ctrl+Shift+B";
constexpr std::string_view kPulseAccentShortcut = "Ctrl+Shift+P";
constexpr std::string_view kNativeXCUIOverlayShortcut = "Ctrl+Shift+O";
@@ -164,8 +163,6 @@ bool XCUIShellChromeState::ToggleHostedPreviewMode(XCUIShellPanelId panelId) {
bool XCUIShellChromeState::GetViewToggle(XCUIShellViewToggleId toggleId) const {
switch (toggleId) {
case XCUIShellViewToggleId::LegacyHostDemoWindow:
return m_viewToggles.legacyHostDemoWindowVisible;
case XCUIShellViewToggleId::NativeBackdrop:
return m_viewToggles.nativeBackdropVisible;
case XCUIShellViewToggleId::PulseAccent:
@@ -183,9 +180,6 @@ bool XCUIShellChromeState::GetViewToggle(XCUIShellViewToggleId toggleId) const {
bool XCUIShellChromeState::SetViewToggle(XCUIShellViewToggleId toggleId, bool enabled) {
bool* target = nullptr;
switch (toggleId) {
case XCUIShellViewToggleId::LegacyHostDemoWindow:
target = &m_viewToggles.legacyHostDemoWindowVisible;
break;
case XCUIShellViewToggleId::NativeBackdrop:
target = &m_viewToggles.nativeBackdropVisible;
break;
@@ -227,9 +221,6 @@ bool XCUIShellChromeState::InvokeCommand(std::string_view commandId) {
if (commandId == XCUIShellChromeCommandIds::ToggleXCUILayoutLabPanel) {
return TogglePanelVisible(XCUIShellPanelId::XCUILayoutLab);
}
if (commandId == XCUIShellChromeCommandIds::ToggleLegacyHostDemoWindow) {
return ToggleViewToggle(XCUIShellViewToggleId::LegacyHostDemoWindow);
}
if (commandId == XCUIShellChromeCommandIds::ToggleNativeBackdrop) {
return ToggleViewToggle(XCUIShellViewToggleId::NativeBackdrop);
}
@@ -288,15 +279,6 @@ bool XCUIShellChromeState::TryGetCommandDescriptor(
return true;
}
if (commandId == GetViewToggleCommandId(XCUIShellViewToggleId::LegacyHostDemoWindow)) {
outDescriptor.label = "Legacy Host Demo";
outDescriptor.shortcut = kLegacyHostDemoShortcut;
outDescriptor.commandId = commandId;
outDescriptor.checkable = true;
outDescriptor.checked = GetViewToggle(XCUIShellViewToggleId::LegacyHostDemoWindow);
outDescriptor.enabled = true;
return true;
}
if (commandId == GetViewToggleCommandId(XCUIShellViewToggleId::NativeBackdrop)) {
outDescriptor.label = "Native Backdrop";
outDescriptor.shortcut = kNativeBackdropShortcut;
@@ -358,7 +340,7 @@ bool XCUIShellChromeState::TryGetCommandDescriptor(
XCUIShellMenuDescriptor XCUIShellChromeState::BuildViewMenuDescriptor() const {
XCUIShellMenuDescriptor descriptor = {};
descriptor.label = kViewMenuLabel;
descriptor.items.reserve(10u);
descriptor.items.reserve(9u);
const auto appendCommandItem = [this, &descriptor](std::string_view commandId) {
XCUIShellCommandDescriptor commandDescriptor = {};
@@ -374,7 +356,6 @@ XCUIShellMenuDescriptor XCUIShellChromeState::BuildViewMenuDescriptor() const {
appendCommandItem(GetPanelVisibilityCommandId(XCUIShellPanelId::XCUIDemo));
appendCommandItem(GetPanelVisibilityCommandId(XCUIShellPanelId::XCUILayoutLab));
appendCommandItem(GetViewToggleCommandId(XCUIShellViewToggleId::LegacyHostDemoWindow));
descriptor.items.push_back({ XCUIShellMenuItemKind::Separator, {} });
@@ -414,8 +395,6 @@ std::string_view XCUIShellChromeState::GetPanelPreviewModeCommandId(XCUIShellPan
std::string_view XCUIShellChromeState::GetViewToggleCommandId(XCUIShellViewToggleId toggleId) {
switch (toggleId) {
case XCUIShellViewToggleId::LegacyHostDemoWindow:
return XCUIShellChromeCommandIds::ToggleLegacyHostDemoWindow;
case XCUIShellViewToggleId::NativeBackdrop:
return XCUIShellChromeCommandIds::ToggleNativeBackdrop;
case XCUIShellViewToggleId::PulseAccent: