Fix all-platform validation blockers
This commit is contained in:
@@ -61,7 +61,7 @@ void App::set_platform_services(pp::platform::PlatformServices* services) noexce
|
|||||||
#ifdef __LINUX__
|
#ifdef __LINUX__
|
||||||
if (services)
|
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)
|
if (!glfw_window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ void App::set_platform_services(pp::platform::PlatformServices* services) noexce
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pp::platform::linux::set_fps_title_callback({});
|
pp::platform::linux_desktop::set_fps_title_callback({});
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
16
src/pch.h
16
src/pch.h
@@ -22,6 +22,8 @@
|
|||||||
#define SHADER_VERSION "#version 300 es\n"
|
#define SHADER_VERSION "#version 300 es\n"
|
||||||
#define __GLES__ 1
|
#define __GLES__ 1
|
||||||
#define PP_OS "ios"
|
#define PP_OS "ios"
|
||||||
|
#undef WITH_CURL
|
||||||
|
#define WITH_CURL 0
|
||||||
#else
|
#else
|
||||||
#define __OSX__ 1
|
#define __OSX__ 1
|
||||||
#ifdef __OBJC__
|
#ifdef __OBJC__
|
||||||
@@ -33,6 +35,9 @@
|
|||||||
#define SHADER_VERSION "#version 150\n"
|
#define SHADER_VERSION "#version 150\n"
|
||||||
#define __GL__ 1
|
#define __GL__ 1
|
||||||
#define PP_OS "osx"
|
#define PP_OS "osx"
|
||||||
|
#ifndef WITH_CURL
|
||||||
|
#define WITH_CURL 1
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@@ -40,7 +45,6 @@
|
|||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <dispatch/dispatch.h>
|
#include <dispatch/dispatch.h>
|
||||||
#define BT_SetTerminate void
|
#define BT_SetTerminate void
|
||||||
#define WITH_CURL 1
|
|
||||||
|
|
||||||
#elif __ANDROID__
|
#elif __ANDROID__
|
||||||
|
|
||||||
@@ -51,7 +55,9 @@
|
|||||||
|
|
||||||
#include <android/sensor.h>
|
#include <android/sensor.h>
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
|
#if __has_include(<android_native_app_glue.h>)
|
||||||
#include <android_native_app_glue.h>
|
#include <android_native_app_glue.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SHADER_VERSION "#version 300 es\n"
|
#define SHADER_VERSION "#version 300 es\n"
|
||||||
#define PP_OS "android"
|
#define PP_OS "android"
|
||||||
@@ -59,7 +65,9 @@
|
|||||||
#define __block
|
#define __block
|
||||||
//#define STBI_NEON
|
//#define STBI_NEON
|
||||||
#define BT_SetTerminate void
|
#define BT_SetTerminate void
|
||||||
|
#ifndef WITH_CURL
|
||||||
#define WITH_CURL 1
|
#define WITH_CURL 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#elif _WIN32
|
#elif _WIN32
|
||||||
|
|
||||||
@@ -89,7 +97,9 @@
|
|||||||
#define SHADER_VERSION "#version 150\n"
|
#define SHADER_VERSION "#version 150\n"
|
||||||
#define PP_OS "win"
|
#define PP_OS "win"
|
||||||
#define __block
|
#define __block
|
||||||
|
#ifndef WITH_CURL
|
||||||
#define WITH_CURL 1
|
#define WITH_CURL 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#elif __linux__
|
#elif __linux__
|
||||||
|
|
||||||
@@ -109,7 +119,9 @@
|
|||||||
#define __GL__ 1
|
#define __GL__ 1
|
||||||
#define __block
|
#define __block
|
||||||
#define BT_SetTerminate void
|
#define BT_SetTerminate void
|
||||||
|
#ifndef WITH_CURL
|
||||||
#define WITH_CURL 1
|
#define WITH_CURL 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#elif defined(EMSCRIPTEN)
|
#elif defined(EMSCRIPTEN)
|
||||||
|
|
||||||
@@ -184,6 +196,6 @@
|
|||||||
#include <stb/stb_image_write.h>
|
#include <stb/stb_image_write.h>
|
||||||
#include <sqlite3.h>
|
#include <sqlite3.h>
|
||||||
|
|
||||||
#ifndef EMSCRIPTEN
|
#if defined(WITH_CURL) && WITH_CURL && !defined(EMSCRIPTEN)
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ PlatformFamily current_platform_family() noexcept
|
|||||||
#elif defined(__ANDROID__)
|
#elif defined(__ANDROID__)
|
||||||
return PlatformFamily::android;
|
return PlatformFamily::android;
|
||||||
#elif defined(__LINUX__)
|
#elif defined(__LINUX__)
|
||||||
return PlatformFamily::linux;
|
return PlatformFamily::linux_desktop;
|
||||||
#elif defined(__WEB__)
|
#elif defined(__WEB__)
|
||||||
return PlatformFamily::webgl;
|
return PlatformFamily::webgl;
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ enum class PlatformFamily {
|
|||||||
macos,
|
macos,
|
||||||
ios,
|
ios,
|
||||||
android,
|
android,
|
||||||
linux,
|
linux_desktop,
|
||||||
webgl,
|
webgl,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -649,7 +649,7 @@ public:
|
|||||||
void report_rendered_frames(int frames) override
|
void report_rendered_frames(int frames) override
|
||||||
{
|
{
|
||||||
#ifdef __LINUX__
|
#ifdef __LINUX__
|
||||||
pp::platform::linux::report_rendered_frames(frames);
|
pp::platform::linux_desktop::report_rendered_frames(frames);
|
||||||
#else
|
#else
|
||||||
(void)frames;
|
(void)frames;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
namespace pp::platform::linux {
|
namespace pp::platform::linux_desktop {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
std::function<void(std::string)> g_fps_title_callback;
|
std::function<void(std::string)> g_fps_title_callback;
|
||||||
@@ -31,7 +31,7 @@ void report_rendered_frames(int frames)
|
|||||||
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
namespace pp::platform::linux {
|
namespace pp::platform::linux_desktop {
|
||||||
|
|
||||||
void set_fps_title_callback(std::function<void(std::string)> callback)
|
void set_fps_title_callback(std::function<void(std::string)> callback)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace pp::platform::linux {
|
namespace pp::platform::linux_desktop {
|
||||||
|
|
||||||
void set_fps_title_callback(std::function<void(std::string)> callback);
|
void set_fps_title_callback(std::function<void(std::string)> callback);
|
||||||
void report_rendered_frames(int frames);
|
void report_rendered_frames(int frames);
|
||||||
|
|||||||
@@ -307,8 +307,7 @@ target_compile_definitions(pp_paint_renderer_compositor_tests PRIVATE
|
|||||||
_SCL_SECURE_NO_WARNINGS
|
_SCL_SECURE_NO_WARNINGS
|
||||||
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
|
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
|
||||||
_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
|
_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
|
||||||
_CONSOLE
|
_CONSOLE)
|
||||||
WITH_CURL=1)
|
|
||||||
target_precompile_headers(pp_paint_renderer_compositor_tests PRIVATE
|
target_precompile_headers(pp_paint_renderer_compositor_tests PRIVATE
|
||||||
"${PROJECT_SOURCE_DIR}/src/pch.h")
|
"${PROJECT_SOURCE_DIR}/src/pch.h")
|
||||||
|
|
||||||
@@ -336,8 +335,7 @@ target_compile_definitions(pp_paint_renderer_stroke_execution_tests PRIVATE
|
|||||||
_SCL_SECURE_NO_WARNINGS
|
_SCL_SECURE_NO_WARNINGS
|
||||||
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
|
_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING
|
||||||
_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
|
_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING
|
||||||
_CONSOLE
|
_CONSOLE)
|
||||||
WITH_CURL=1)
|
|
||||||
target_precompile_headers(pp_paint_renderer_stroke_execution_tests PRIVATE
|
target_precompile_headers(pp_paint_renderer_stroke_execution_tests PRIVATE
|
||||||
"${PROJECT_SOURCE_DIR}/src/pch.h")
|
"${PROJECT_SOURCE_DIR}/src/pch.h")
|
||||||
|
|
||||||
|
|||||||
@@ -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.remove_matching_unique_task);
|
||||||
PP_EXPECT(harness, !plan.notify_worker);
|
PP_EXPECT(harness, !plan.notify_worker);
|
||||||
PP_EXPECT(harness, !plan.wait_for_completion);
|
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);
|
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);
|
harness.run("dispatch plan rejects unsafe cross-thread work under load", dispatch_plan_rejects_cross_thread_mutations_under_pressure);
|
||||||
return harness.finish();
|
return harness.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user