[windows] Support win_debug_x86 compilation target in engine (flutter/engine#30417)
This commit is contained in:
@@ -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<GLGetStringProc>(proc_resolver("glGetString"));
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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'])
|
||||
|
||||
|
||||
@@ -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<std::pair<std::string, std::string>> items;
|
||||
|
||||
items.emplace_back("Severity", VkDebugReportFlagsEXTToString(flags));
|
||||
|
||||
Reference in New Issue
Block a user