Fix all-platform validation blockers

This commit is contained in:
2026-06-16 10:26:07 +02:00
parent 4a5bb68fe2
commit 6a9c415d85
9 changed files with 29 additions and 20 deletions

View File

@@ -61,7 +61,7 @@ void App::set_platform_services(pp::platform::PlatformServices* services) noexce
#ifdef __LINUX__
if (services)
{
pp::platform::linux::set_fps_title_callback([this](std::string title) {
pp::platform::linux_desktop::set_fps_title_callback([this](std::string title) {
if (!glfw_window)
return;
@@ -70,7 +70,7 @@ void App::set_platform_services(pp::platform::PlatformServices* services) noexce
}
else
{
pp::platform::linux::set_fps_title_callback({});
pp::platform::linux_desktop::set_fps_title_callback({});
}
#endif
}

View File

@@ -22,6 +22,8 @@
#define SHADER_VERSION "#version 300 es\n"
#define __GLES__ 1
#define PP_OS "ios"
#undef WITH_CURL
#define WITH_CURL 0
#else
#define __OSX__ 1
#ifdef __OBJC__
@@ -33,6 +35,9 @@
#define SHADER_VERSION "#version 150\n"
#define __GL__ 1
#define PP_OS "osx"
#ifndef WITH_CURL
#define WITH_CURL 1
#endif
#endif
#include <sys/stat.h>
@@ -40,7 +45,6 @@
#include <dirent.h>
#include <dispatch/dispatch.h>
#define BT_SetTerminate void
#define WITH_CURL 1
#elif __ANDROID__
@@ -51,7 +55,9 @@
#include <android/sensor.h>
#include <android/log.h>
#include <android_native_app_glue.h>
#if __has_include(<android_native_app_glue.h>)
#include <android_native_app_glue.h>
#endif
#define SHADER_VERSION "#version 300 es\n"
#define PP_OS "android"
@@ -59,7 +65,9 @@
#define __block
//#define STBI_NEON
#define BT_SetTerminate void
#define WITH_CURL 1
#ifndef WITH_CURL
#define WITH_CURL 1
#endif
#elif _WIN32
@@ -89,7 +97,9 @@
#define SHADER_VERSION "#version 150\n"
#define PP_OS "win"
#define __block
#define WITH_CURL 1
#ifndef WITH_CURL
#define WITH_CURL 1
#endif
#elif __linux__
@@ -109,7 +119,9 @@
#define __GL__ 1
#define __block
#define BT_SetTerminate void
#define WITH_CURL 1
#ifndef WITH_CURL
#define WITH_CURL 1
#endif
#elif defined(EMSCRIPTEN)
@@ -184,6 +196,6 @@
#include <stb/stb_image_write.h>
#include <sqlite3.h>
#ifndef EMSCRIPTEN
#if defined(WITH_CURL) && WITH_CURL && !defined(EMSCRIPTEN)
#include <curl/curl.h>
#endif

View File

@@ -13,7 +13,7 @@ PlatformFamily current_platform_family() noexcept
#elif defined(__ANDROID__)
return PlatformFamily::android;
#elif defined(__LINUX__)
return PlatformFamily::linux;
return PlatformFamily::linux_desktop;
#elif defined(__WEB__)
return PlatformFamily::webgl;
#elif defined(_WIN32)

View File

@@ -13,7 +13,7 @@ enum class PlatformFamily {
macos,
ios,
android,
linux,
linux_desktop,
webgl,
};

View File

@@ -649,7 +649,7 @@ public:
void report_rendered_frames(int frames) override
{
#ifdef __LINUX__
pp::platform::linux::report_rendered_frames(frames);
pp::platform::linux_desktop::report_rendered_frames(frames);
#else
(void)frames;
#endif

View File

@@ -4,7 +4,7 @@
#include <string>
#include <utility>
namespace pp::platform::linux {
namespace pp::platform::linux_desktop {
namespace {
std::function<void(std::string)> g_fps_title_callback;
@@ -31,7 +31,7 @@ void report_rendered_frames(int frames)
}
#else
namespace pp::platform::linux {
namespace pp::platform::linux_desktop {
void set_fps_title_callback(std::function<void(std::string)> callback)
{

View File

@@ -3,7 +3,7 @@
#include <functional>
#include <string>
namespace pp::platform::linux {
namespace pp::platform::linux_desktop {
void set_fps_title_callback(std::function<void(std::string)> callback);
void report_rendered_frames(int frames);

View File

@@ -307,8 +307,7 @@ target_compile_definitions(pp_paint_renderer_compositor_tests PRIVATE
_SCL_SECURE_NO_WARNINGS
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
_CONSOLE
WITH_CURL=1)
_CONSOLE)
target_precompile_headers(pp_paint_renderer_compositor_tests PRIVATE
"${PROJECT_SOURCE_DIR}/src/pch.h")
@@ -336,8 +335,7 @@ target_compile_definitions(pp_paint_renderer_stroke_execution_tests PRIVATE
_SCL_SECURE_NO_WARNINGS
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
_CONSOLE
WITH_CURL=1)
_CONSOLE)
target_precompile_headers(pp_paint_renderer_stroke_execution_tests PRIVATE
"${PROJECT_SOURCE_DIR}/src/pch.h")

View File

@@ -46,7 +46,7 @@ void dispatch_plan_handles_target_thread_with_rejection_flag(pp::tests::Harness&
PP_EXPECT(harness, !plan.remove_matching_unique_task);
PP_EXPECT(harness, !plan.notify_worker);
PP_EXPECT(harness, !plan.wait_for_completion);
PP_EXPECT(harness, !plan.request_redraw);
PP_EXPECT(harness, plan.request_redraw);
PP_EXPECT(harness, !plan.reject_unsafe_cross_thread_dispatch);
}
}
@@ -85,4 +85,3 @@ int main()
harness.run("dispatch plan rejects unsafe cross-thread work under load", dispatch_plan_rejects_cross_thread_mutations_under_pressure);
return harness.finish();
}