Harden editor app windowing boundary

This commit is contained in:
2026-04-26 16:01:07 +08:00
parent f4afaf184e
commit ac626d48c4
31 changed files with 473 additions and 553 deletions

View File

@@ -1,7 +1,6 @@
#include "Platform/Win32/Runtime/EditorWindowRuntimeController.h"
#include "Bootstrap/EditorResources.h"
#include "Composition/EditorContext.h"
#include "Platform/Win32/Windowing/EditorWindowSupport.h"
#include "Support/EmbeddedPngLoader.h"
@@ -157,8 +156,8 @@ bool EditorWindowRuntimeController::Initialize(
LogRuntimeTrace("app", attachResult.warning);
}
editorContext.AttachTextMeasurer(m_textSystem);
assert(m_contentController != nullptr);
m_contentController->PrepareEditorContext(editorContext, m_textSystem);
m_contentController->Initialize(EditorWindowContentInitializationContext{
.repoRoot = repoRoot,
.editorContext = editorContext,
@@ -193,7 +192,7 @@ bool EditorWindowRuntimeController::Initialize(
m_screenshotController.Initialize(captureRoot);
if (autoCaptureOnStartup) {
m_screenshotController.RequestCapture("startup");
editorContext.SetStatus("Capture", "Startup capture requested.");
m_contentController->NotifyStartupCaptureRequested(editorContext);
}
return true;
@@ -254,6 +253,26 @@ bool EditorWindowRuntimeController::ApplyResize(UINT width, UINT height) {
return resizeResult.hasViewportSurfacePresentation;
}
void EditorWindowRuntimeController::PrepareEditorContext(EditorContext& editorContext) {
if (m_contentController != nullptr) {
m_contentController->PrepareEditorContext(editorContext, m_textSystem);
}
}
bool EditorWindowRuntimeController::IsEditorContextValid(
const EditorContext& editorContext) const {
return m_contentController != nullptr &&
m_contentController->IsEditorContextValid(editorContext);
}
void EditorWindowRuntimeController::AppendInvalidFrame(
const EditorContext& editorContext,
::XCEngine::UI::UIDrawList& drawList) const {
if (m_contentController != nullptr) {
m_contentController->AppendInvalidFrame(editorContext, drawList);
}
}
Host::D3D12WindowRenderLoopFrameContext EditorWindowRuntimeController::BeginFrame() {
UpdateFrameTiming();
return m_windowRenderLoop.BeginFrame();