diff --git a/engine/src/flutter/impeller/base/comparable.cc b/engine/src/flutter/impeller/base/comparable.cc index 96463d6e71..58585c393f 100644 --- a/engine/src/flutter/impeller/base/comparable.cc +++ b/engine/src/flutter/impeller/base/comparable.cc @@ -4,6 +4,8 @@ #include "impeller/base/comparable.h" +#include + namespace impeller { static std::atomic_size_t sLastID; diff --git a/engine/src/flutter/impeller/base/thread.h b/engine/src/flutter/impeller/base/thread.h index da200bc8d9..9d44b7681c 100644 --- a/engine/src/flutter/impeller/base/thread.h +++ b/engine/src/flutter/impeller/base/thread.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include #include "flutter/fml/macros.h" diff --git a/engine/src/flutter/impeller/compiler/impellerc_main.cc b/engine/src/flutter/impeller/compiler/impellerc_main.cc index f61b112604..ca19e15536 100644 --- a/engine/src/flutter/impeller/compiler/impellerc_main.cc +++ b/engine/src/flutter/impeller/compiler/impellerc_main.cc @@ -52,9 +52,9 @@ bool Main(const fml::CommandLine& command_line) { reflector_options.shader_name = InferShaderNameFromPath(switches.source_file_name); reflector_options.header_file_name = - std::filesystem::path{switches.reflection_header_name} - .filename() - .native(); + ToUtf8(std::filesystem::path{switches.reflection_header_name} + .filename() + .native()); Compiler compiler(*source_file_mapping, options, reflector_options); if (!compiler.IsValid()) { diff --git a/engine/src/flutter/impeller/compiler/switches.cc b/engine/src/flutter/impeller/compiler/switches.cc index f3caea51d2..b29dcac31a 100644 --- a/engine/src/flutter/impeller/compiler/switches.cc +++ b/engine/src/flutter/impeller/compiler/switches.cc @@ -62,10 +62,10 @@ static TargetPlatform TargetPlatformFromCommandLine( Switches::Switches(const fml::CommandLine& command_line) : target_platform(TargetPlatformFromCommandLine(command_line)), - working_directory(std::make_shared( - fml::OpenDirectory(std::filesystem::current_path().native().c_str(), - false, // create if necessary, - fml::FilePermission::kRead))), + working_directory(std::make_shared(fml::OpenDirectory( + ToUtf8(std::filesystem::current_path().native()).c_str(), + false, // create if necessary, + fml::FilePermission::kRead))), source_file_name(command_line.GetOptionValueWithDefault("input", "")), sl_file_name(command_line.GetOptionValueWithDefault("sl", "")), spirv_file_name(command_line.GetOptionValueWithDefault("spirv", "")), diff --git a/engine/src/flutter/impeller/compiler/switches.h b/engine/src/flutter/impeller/compiler/switches.h index 173ac20838..5e1979d026 100644 --- a/engine/src/flutter/impeller/compiler/switches.h +++ b/engine/src/flutter/impeller/compiler/switches.h @@ -12,6 +12,7 @@ #include "flutter/fml/unique_fd.h" #include "impeller/compiler/compiler.h" #include "impeller/compiler/include_dir.h" +#include "impeller/compiler/types.h" namespace impeller { namespace compiler { diff --git a/engine/src/flutter/impeller/compiler/types.cc b/engine/src/flutter/impeller/compiler/types.cc index adbf277dfa..f8a03459ec 100644 --- a/engine/src/flutter/impeller/compiler/types.cc +++ b/engine/src/flutter/impeller/compiler/types.cc @@ -60,7 +60,7 @@ static std::string UniqueEntryPointFunctionNameFromSourceName( SourceType type) { std::stringstream stream; std::filesystem::path file_path(file_name); - stream << file_path.stem().native() << "_"; + stream << ToUtf8(file_path.stem().native()) << "_"; switch (type) { case SourceType::kUnknown: stream << "unknown"; @@ -212,5 +212,14 @@ std::string TargetPlatformSLExtension(TargetPlatform platform) { FML_UNREACHABLE(); } +std::string ToUtf8(const std::wstring& wstring) { + std::wstring_convert> myconv; + return myconv.to_bytes(wstring); +} + +std::string ToUtf8(const std::string& string) { + return string; +} + } // namespace compiler } // namespace impeller diff --git a/engine/src/flutter/impeller/compiler/types.h b/engine/src/flutter/impeller/compiler/types.h index b760122b38..5ad762e0a3 100644 --- a/engine/src/flutter/impeller/compiler/types.h +++ b/engine/src/flutter/impeller/compiler/types.h @@ -4,6 +4,8 @@ #pragma once +#include +#include #include #include "flutter/fml/macros.h" @@ -54,5 +56,9 @@ spv::ExecutionModel ToExecutionModel(SourceType type); spirv_cross::CompilerMSL::Options::Platform TargetPlatformToMSLPlatform( TargetPlatform platform); +std::string ToUtf8(const std::wstring& wstring); + +std::string ToUtf8(const std::string& string); + } // namespace compiler } // namespace impeller diff --git a/engine/src/flutter/impeller/compiler/utilities.cc b/engine/src/flutter/impeller/compiler/utilities.cc index 78fa5df5e4..a191eb9a75 100644 --- a/engine/src/flutter/impeller/compiler/utilities.cc +++ b/engine/src/flutter/impeller/compiler/utilities.cc @@ -6,6 +6,7 @@ #include #include +#include namespace impeller { namespace compiler { diff --git a/engine/src/flutter/impeller/geometry/rect.h b/engine/src/flutter/impeller/geometry/rect.h index bd08001b11..1a5675a790 100644 --- a/engine/src/flutter/impeller/geometry/rect.h +++ b/engine/src/flutter/impeller/geometry/rect.h @@ -147,7 +147,7 @@ struct TRect { constexpr std::array, 4> GetTransformedPoints( const Matrix& transform) const { auto points = GetPoints(); - for (uint i = 0; i < points.size(); i++) { + for (int i = 0; i < points.size(); i++) { points[i] = transform * points[i]; } return points; diff --git a/engine/src/flutter/impeller/geometry/size.h b/engine/src/flutter/impeller/geometry/size.h index b3dee0cec7..6cb55cab47 100644 --- a/engine/src/flutter/impeller/geometry/size.h +++ b/engine/src/flutter/impeller/geometry/size.h @@ -4,6 +4,7 @@ #pragma once +#include #include #include #include