关键节点
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
#include "Platform/Win32/Runtime/EditorWindowFrameDriver.h"
|
||||
|
||||
#include "Platform/Win32/Chrome/EditorWindowChromeController.h"
|
||||
#include "Platform/Win32/Windowing/EditorWindow.h"
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
EditorWindowFrameTransferRequests EditorWindowFrameDriver::DriveFrameInternal(
|
||||
EditorWindow& window,
|
||||
EditorContext& editorContext,
|
||||
bool globalTabDragActive,
|
||||
bool requestSkipNextSteadyStateFrame) {
|
||||
if (!window.IsRenderReady() ||
|
||||
window.GetHwnd() == nullptr ||
|
||||
window.GetLifecycleState() != EditorWindowLifecycleState::Running) {
|
||||
return {};
|
||||
}
|
||||
|
||||
EditorWindowFrameTransferRequests transferRequests =
|
||||
window.RenderFrame(editorContext, globalTabDragActive);
|
||||
if (const HWND hwnd = window.GetHwnd();
|
||||
hwnd != nullptr && IsWindow(hwnd)) {
|
||||
ValidateRect(hwnd, nullptr);
|
||||
}
|
||||
if (requestSkipNextSteadyStateFrame) {
|
||||
window.RequestSkipNextSteadyStateFrame();
|
||||
}
|
||||
|
||||
return transferRequests;
|
||||
}
|
||||
|
||||
EditorWindowFrameTransferRequests EditorWindowFrameDriver::DriveFrame(
|
||||
EditorWindow& window,
|
||||
EditorContext& editorContext,
|
||||
bool globalTabDragActive) {
|
||||
return DriveFrameInternal(window, editorContext, globalTabDragActive, false);
|
||||
}
|
||||
|
||||
EditorWindowFrameTransferRequests EditorWindowFrameDriver::DriveImmediateFrame(
|
||||
EditorWindow& window,
|
||||
EditorContext& editorContext,
|
||||
bool globalTabDragActive) {
|
||||
return DriveFrameInternal(window, editorContext, globalTabDragActive, true);
|
||||
}
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
Reference in New Issue
Block a user