diff --git a/shell/gpu/gpu_surface_gl_delegate.cc b/shell/gpu/gpu_surface_gl_delegate.cc index 2edd3823bdadf..2aea45cf21d52 100644 --- a/shell/gpu/gpu_surface_gl_delegate.cc +++ b/shell/gpu/gpu_surface_gl_delegate.cc @@ -40,7 +40,11 @@ static bool IsProcResolverOpenGLES( #define GPU_GL_VERSION 0x1F02 constexpr char kGLESVersionPrefix[] = "OpenGL ES"; +#ifdef WIN32 + using GLGetStringProc = const char*(__stdcall*)(uint32_t); +#else using GLGetStringProc = const char* (*)(uint32_t); +#endif GLGetStringProc gl_get_string = reinterpret_cast(proc_resolver("glGetString")); diff --git a/shell/platform/windows/keyboard_win32_unittests.cc b/shell/platform/windows/keyboard_win32_unittests.cc index fe503b2a9c49d..b90f274285f6c 100644 --- a/shell/platform/windows/keyboard_win32_unittests.cc +++ b/shell/platform/windows/keyboard_win32_unittests.cc @@ -284,8 +284,8 @@ class MockKeyboardManagerWin32Delegate forged_message_expectations_.front(); forged_message_expectations_.pop_front(); EXPECT_EQ(expectation.message.message, Msg); - EXPECT_EQ(expectation.message.wParam, wParam & 0xffffffff); - EXPECT_EQ(expectation.message.lParam, lParam & 0xffffffff); + EXPECT_EQ(expectation.message.wParam, wParam); + EXPECT_EQ(expectation.message.lParam, lParam); if (expectation.message.expected_result != kWmResultDontCheck) { EXPECT_EQ(expectation.message.expected_result, handled ? kWmResultZero : kWmResultDefault); diff --git a/shell/platform/windows/testing/wm_builders.cc b/shell/platform/windows/testing/wm_builders.cc index 520ac00d45147..a9e3ff9fdcf9d 100644 --- a/shell/platform/windows/testing/wm_builders.cc +++ b/shell/platform/windows/testing/wm_builders.cc @@ -8,8 +8,8 @@ namespace flutter { namespace testing { Win32Message WmKeyDownInfo::Build(LRESULT expected_result) { - uint32_t lParam = (repeat_count << 0) | (scan_code << 16) | (extended << 24) | - (prev_state << 30); + LPARAM lParam = (repeat_count << 0) | (scan_code << 16) | (extended << 24) | + (prev_state << 30); return Win32Message{ .message = WM_KEYDOWN, .wParam = key, @@ -19,9 +19,9 @@ Win32Message WmKeyDownInfo::Build(LRESULT expected_result) { } Win32Message WmKeyUpInfo::Build(LRESULT expected_result) { - uint32_t lParam = (1 /* repeat_count */ << 0) | (scan_code << 16) | - (extended << 24) | (!overwrite_prev_state_0 << 30) | - (1 /* transition */ << 31); + LPARAM lParam = (1 /* repeat_count */ << 0) | (scan_code << 16) | + (extended << 24) | (!overwrite_prev_state_0 << 30) | + (1 /* transition */ << 31); return Win32Message{ .message = WM_KEYUP, .wParam = key, @@ -31,9 +31,9 @@ Win32Message WmKeyUpInfo::Build(LRESULT expected_result) { } Win32Message WmCharInfo::Build(LRESULT expected_result) { - uint32_t lParam = (repeat_count << 0) | (scan_code << 16) | (extended << 24) | - (bit25 << 25) | (context << 29) | (prev_state << 30) | - (transition << 31); + LPARAM lParam = (repeat_count << 0) | (scan_code << 16) | (extended << 24) | + (bit25 << 25) | (context << 29) | (prev_state << 30) | + (transition << 31); return Win32Message{ .message = WM_CHAR, .wParam = char_code, @@ -43,9 +43,9 @@ Win32Message WmCharInfo::Build(LRESULT expected_result) { } Win32Message WmSysKeyDownInfo::Build(LRESULT expected_result) { - uint32_t lParam = (repeat_count << 0) | (scan_code << 16) | (extended << 24) | - (context << 29) | (prev_state << 30) | - (0 /* transition */ << 31); + LPARAM lParam = (repeat_count << 0) | (scan_code << 16) | (extended << 24) | + (context << 29) | (prev_state << 30) | + (0 /* transition */ << 31); return Win32Message{ .message = WM_SYSKEYDOWN, .wParam = key, @@ -55,9 +55,9 @@ Win32Message WmSysKeyDownInfo::Build(LRESULT expected_result) { } Win32Message WmSysKeyUpInfo::Build(LRESULT expected_result) { - uint32_t lParam = (1 /* repeat_count */ << 0) | (scan_code << 16) | - (extended << 24) | (context << 29) | - (1 /* prev_state */ << 30) | (1 /* transition */ << 31); + LPARAM lParam = (1 /* repeat_count */ << 0) | (scan_code << 16) | + (extended << 24) | (context << 29) | + (1 /* prev_state */ << 30) | (1 /* transition */ << 31); return Win32Message{ .message = WM_SYSKEYUP, .wParam = key, @@ -67,8 +67,8 @@ Win32Message WmSysKeyUpInfo::Build(LRESULT expected_result) { } Win32Message WmDeadCharInfo::Build(LRESULT expected_result) { - uint32_t lParam = (repeat_count << 0) | (scan_code << 16) | (extended << 24) | - (context << 30) | (prev_state << 30) | (transition << 31); + LPARAM lParam = (repeat_count << 0) | (scan_code << 16) | (extended << 24) | + (context << 30) | (prev_state << 30) | (transition << 31); return Win32Message{ .message = WM_DEADCHAR, .wParam = char_code, diff --git a/third_party/txt/src/utils/WindowsUtils.h b/third_party/txt/src/utils/WindowsUtils.h index fc30637a6c979..9c1af86781f01 100644 --- a/third_party/txt/src/utils/WindowsUtils.h +++ b/third_party/txt/src/utils/WindowsUtils.h @@ -42,7 +42,11 @@ inline unsigned int clz_win(unsigned int num) { inline unsigned int clzl_win(unsigned long num) { unsigned long r = 0; +#if defined(_WIN64) _BitScanReverse64(&r, num); +#else + _BitScanReverse(&r, num); +#endif return r; } diff --git a/tools/gn b/tools/gn index 3c96f82dadd92..8d19b9dd24688 100755 --- a/tools/gn +++ b/tools/gn @@ -75,7 +75,7 @@ def to_command_line(gn_args): return [merge(x, y) for x, y in gn_args.items()] def cpu_for_target_arch(arch): - if arch in ['ia32', 'arm', 'armv6', 'armv5te', 'mips', + if arch in ['ia32', 'x86', 'arm', 'armv6', 'armv5te', 'mips', 'simarm', 'simarmv6', 'simarmv5te', 'simmips', 'simdbc', 'armsimdbc']: return 'x86' @@ -208,7 +208,7 @@ def to_gn_args(args): if runtime_mode == 'debug': gn_args['dart_runtime_mode'] = 'develop' elif runtime_mode == 'jit_release': - gn_args['dart_runtime_mode'] = 'release'; + gn_args['dart_runtime_mode'] = 'release' else: gn_args['dart_runtime_mode'] = runtime_mode @@ -446,11 +446,12 @@ def parse_args(args): parser.add_argument('--simulator', action='store_true', default=False) parser.add_argument('--linux', dest='target_os', action='store_const', const='linux') parser.add_argument('--fuchsia', dest='target_os', action='store_const', const='fuchsia') + parser.add_argument('--windows', dest='target_os', action='store_const', const='win') parser.add_argument('--winuwp', dest='target_os', action='store_const', const='winuwp') parser.add_argument('--linux-cpu', type=str, choices=['x64', 'x86', 'arm64', 'arm']) parser.add_argument('--fuchsia-cpu', type=str, choices=['x64', 'arm64'], default = 'x64') - parser.add_argument('--windows-cpu', type=str, choices=['x64', 'arm64'], default = 'x64') + parser.add_argument('--windows-cpu', type=str, choices=['x64', 'arm64', 'x86'], default = 'x64') parser.add_argument('--simulator-cpu', type=str, choices=['x64', 'arm64'], default = 'x64') parser.add_argument('--arm-float-abi', type=str, choices=['hard', 'soft', 'softfp']) diff --git a/vulkan/vulkan_debug_report.cc b/vulkan/vulkan_debug_report.cc index 5994363f67abe..c951b26e79874 100644 --- a/vulkan/vulkan_debug_report.cc +++ b/vulkan/vulkan_debug_report.cc @@ -108,14 +108,17 @@ static const char* VkDebugReportObjectTypeEXTToString( } static VKAPI_ATTR VkBool32 -OnVulkanDebugReportCallback(VkDebugReportFlagsEXT flags, - VkDebugReportObjectTypeEXT object_type, - uint64_t object, - size_t location, - int32_t message_code, - const char* layer_prefix, - const char* message, - void* user_data) { +#ifdef WIN32 + __stdcall +#endif + OnVulkanDebugReportCallback(VkDebugReportFlagsEXT flags, + VkDebugReportObjectTypeEXT object_type, + uint64_t object, + size_t location, + int32_t message_code, + const char* layer_prefix, + const char* message, + void* user_data) { std::vector> items; items.emplace_back("Severity", VkDebugReportFlagsEXTToString(flags));