Contain XCUI ImGui adapters behind explicit host seams

This commit is contained in:
2026-04-05 13:24:14 +08:00
parent 56f596548d
commit f943a07862
23 changed files with 1134 additions and 290 deletions

View File

@@ -260,6 +260,27 @@ public:
}
};
class NullXCUIHostedPreviewPresenter final : public IXCUIHostedPreviewPresenter {
public:
bool Present(const XCUIHostedPreviewFrame& frame) override {
m_lastStats = {};
if (frame.drawData == nullptr) {
return false;
}
m_lastStats.submittedDrawListCount = frame.drawData->GetDrawListCount();
m_lastStats.submittedCommandCount = frame.drawData->GetTotalCommandCount();
return false;
}
const XCUIHostedPreviewStats& GetLastStats() const override {
return m_lastStats;
}
private:
XCUIHostedPreviewStats m_lastStats = {};
};
class QueuedNativeXCUIHostedPreviewPresenter final : public IXCUIHostedPreviewPresenter {
public:
QueuedNativeXCUIHostedPreviewPresenter(
@@ -306,6 +327,10 @@ inline std::unique_ptr<IXCUIHostedPreviewPresenter> CreateQueuedNativeXCUIHosted
return std::make_unique<QueuedNativeXCUIHostedPreviewPresenter>(queue, surfaceRegistry);
}
inline std::unique_ptr<IXCUIHostedPreviewPresenter> CreateNullXCUIHostedPreviewPresenter() {
return std::make_unique<NullXCUIHostedPreviewPresenter>();
}
} // namespace XCUIBackend
} // namespace Editor
} // namespace XCEngine