Retain Apple bridge services and bind Win32 runtime
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
#include "platform_windows/windows_bootstrap_helpers.h"
|
||||
#include "platform_windows/windows_lifecycle_shell.h"
|
||||
#include "platform_windows/windows_platform_services.h"
|
||||
#include "platform_windows/windows_runtime_shell.h"
|
||||
#include "platform_windows/windows_stylus_input.h"
|
||||
#include "platform_windows/windows_window_shell.h"
|
||||
|
||||
#include "app_runtime.h"
|
||||
#include "log.h"
|
||||
#include "legacy_gl_runtime_dispatch.h"
|
||||
#include "legacy_ui_gl_dispatch.h"
|
||||
@@ -171,18 +173,25 @@ void swap_async_render_context()
|
||||
|
||||
void enqueue_main_thread_task(std::packaged_task<void()> task)
|
||||
{
|
||||
if (!App::I)
|
||||
if (auto* runtime = bound_runtime())
|
||||
{
|
||||
task();
|
||||
runtime->main_thread_task(std::move(task));
|
||||
return;
|
||||
}
|
||||
App::I->runtime().main_thread_task(std::move(task));
|
||||
|
||||
if (!task.valid())
|
||||
return;
|
||||
|
||||
task();
|
||||
}
|
||||
|
||||
void drain_main_thread_tasks()
|
||||
{
|
||||
if (App::I)
|
||||
App::I->runtime().drain_main_thread_tasks();
|
||||
if (auto* runtime = bound_runtime())
|
||||
{
|
||||
runtime->drain_main_thread_tasks();
|
||||
return;
|
||||
}
|
||||
}
|
||||
} // namespace pp::platform::windows
|
||||
|
||||
|
||||
Reference in New Issue
Block a user