perf(editor): native Windows preview and UI-first timeline navigation (#11)
Gitea CI / Check code and tests (push) Successful in 8m7s
Gitea CI / Build Windows x64 app (push) Successful in 5m48s
Gitea CI / Build Android APK (push) Successful in 5m59s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m17s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m22s
Gitea CI / Gitea CI passed (push) Successful in 2s

This commit was merged in pull request #11.
This commit is contained in:
lingjhf committed 2026-10-07 10:05:14 +00:00
1 parent 0ecf920669
commit b4cb12cbe3
36 files changed
+3292 -148

No files matched your search

+11 -7
View File
@@ -6,13 +6,9 @@
#include "flutter_window.h"
#include "utils.h"
// Hybrid graphics drivers consult these process-wide hints before Flutter or
// native media creates a D3D device. Keep both texture producers on the same
// preferred adapter; explicit Windows graphics preferences still take priority.
extern "C" {
__declspec(dllexport) DWORD NvOptimusEnablement = 1;
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}
// Windows chooses the default adapter. The native preview matches the GPU that
// produced its shared frame; forcing a discrete GPU can make seeks slower and
// require a cross-adapter transfer to the desktop compositor on hybrid systems.
int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
_In_ wchar_t *command_line, _In_ int show_command) {
@@ -30,6 +26,14 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
flutter::DartProject project(L"data");
// Prefer a fast UI GPU without forcing the video decoder onto that adapter.
// On hybrid systems the two workloads can otherwise delay each other's fences.
// The internal texture comparison needs Flutter's default adapter to import
// the legacy shared video texture; this is not a user-facing mode switch.
wchar_t comparison[2]{};
if (!GetEnvironmentVariableW(L"CUTDEX_PREVIEW_TEXTURE", comparison, 2) || comparison[0] != L'1') {
project.set_gpu_preference(flutter::GpuPreference::HighPerformancePreference);
}
std::vector<std::string> command_line_arguments =
GetCommandLineArguments();