Decouple editor render runtime factory

This commit is contained in:
2026-04-26 19:21:38 +08:00
parent caa54b7878
commit fa4fcbe95b
15 changed files with 120 additions and 46 deletions

View File

@@ -7,6 +7,8 @@
#include "Windowing/Coordinator/EditorWindowWorkspaceCoordinator.h"
#include "Windowing/Runtime/EditorWindowRuntimeController.h"
#include <Rendering/Host/EditorWindowRenderRuntime.h>
#include <XCEditor/Workspace/UIEditorWindowWorkspaceModel.h>
#include <memory>
@@ -18,8 +20,10 @@ namespace XCEngine::UI::Editor::App {
EditorWindowManager::EditorWindowManager(
EditorContext& editorContext,
EditorWindowSystem& windowSystem,
Rendering::Host::EditorWindowRenderRuntimeFactory& renderRuntimeFactory,
EditorWindowHostRuntimeServices& hostRuntime)
: m_editorContext(editorContext)
, m_renderRuntimeFactory(renderRuntimeFactory)
, m_hostRuntime(hostRuntime) {
m_contentFactory = CreateDefaultEditorWindowContentFactory(windowSystem);
m_workspaceCoordinator =
@@ -27,11 +31,13 @@ EditorWindowManager::EditorWindowManager(
m_editorContext,
m_hostRuntime,
windowSystem,
m_renderRuntimeFactory,
*m_contentFactory);
m_utilityCoordinator =
std::make_unique<EditorUtilityWindowCoordinator>(
m_editorContext,
m_hostRuntime,
m_renderRuntimeFactory,
*m_contentFactory);
m_lifecycleCoordinator = std::make_unique<EditorWindowLifecycleCoordinator>(
m_hostRuntime,
@@ -60,7 +66,7 @@ EditorHostWindow* EditorWindowManager::CreateWorkspaceWindow(
std::make_unique<EditorWindowRuntimeController>(
m_editorContext,
m_contentFactory->CreateWorkspaceContentController(windowState),
m_hostRuntime.CreateWindowRenderRuntime()),
m_renderRuntimeFactory.CreateWindowRenderRuntime()),
params);
if (window != nullptr) {
m_workspaceCoordinator->RegisterExistingWindow(*window);
@@ -79,7 +85,7 @@ EditorHostWindow* EditorWindowManager::CreateUtilityWindow(
std::make_unique<EditorWindowRuntimeController>(
m_editorContext,
m_contentFactory->CreateUtilityContentController(descriptor),
m_hostRuntime.CreateWindowRenderRuntime()),
m_renderRuntimeFactory.CreateWindowRenderRuntime()),
params);
if (window != nullptr) {
m_workspaceCoordinator->RegisterExistingWindow(*window);