File tree Expand file tree Collapse file tree 10 files changed +30
-9
lines changed
Expand file tree Collapse file tree 10 files changed +30
-9
lines changed Original file line number Diff line number Diff line change 44
55#include " impeller/base/comparable.h"
66
7+ #include < atomic>
8+
79namespace impeller {
810
911static std::atomic_size_t sLastID ;
Original file line number Diff line number Diff line change 55#pragma once
66
77#include < memory>
8+ #include < mutex>
89#include < thread>
910
1011#include " flutter/fml/macros.h"
Original file line number Diff line number Diff line change @@ -52,9 +52,9 @@ bool Main(const fml::CommandLine& command_line) {
5252 reflector_options.shader_name =
5353 InferShaderNameFromPath (switches.source_file_name );
5454 reflector_options.header_file_name =
55- std::filesystem::path{switches.reflection_header_name }
56- .filename ()
57- .native ();
55+ ToUtf8 ( std::filesystem::path{switches.reflection_header_name }
56+ .filename ()
57+ .native () );
5858
5959 Compiler compiler (*source_file_mapping, options, reflector_options);
6060 if (!compiler.IsValid ()) {
Original file line number Diff line number Diff line change @@ -62,10 +62,10 @@ static TargetPlatform TargetPlatformFromCommandLine(
6262
6363Switches::Switches (const fml::CommandLine& command_line)
6464 : target_platform(TargetPlatformFromCommandLine(command_line)),
65- working_directory (std::make_shared<fml::UniqueFD>(
66- fml::OpenDirectory (std::filesystem::current_path().native().c_str(),
67- false, // create if necessary,
68- fml::FilePermission::kRead))),
65+ working_directory (std::make_shared<fml::UniqueFD>(fml::OpenDirectory(
66+ ToUtf8 (std::filesystem::current_path().native() ).c_str(),
67+ false, // create if necessary,
68+ fml::FilePermission::kRead))),
6969 source_file_name(command_line.GetOptionValueWithDefault(" input" , " " )),
7070 sl_file_name(command_line.GetOptionValueWithDefault(" sl" , " " )),
7171 spirv_file_name(command_line.GetOptionValueWithDefault(" spirv" , " " )),
Original file line number Diff line number Diff line change 1212#include " flutter/fml/unique_fd.h"
1313#include " impeller/compiler/compiler.h"
1414#include " impeller/compiler/include_dir.h"
15+ #include " impeller/compiler/types.h"
1516
1617namespace impeller {
1718namespace compiler {
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ static std::string UniqueEntryPointFunctionNameFromSourceName(
6060 SourceType type) {
6161 std::stringstream stream;
6262 std::filesystem::path file_path (file_name);
63- stream << file_path.stem ().native () << " _" ;
63+ stream << ToUtf8 ( file_path.stem ().native () ) << " _" ;
6464 switch (type) {
6565 case SourceType::kUnknown :
6666 stream << " unknown" ;
@@ -212,5 +212,14 @@ std::string TargetPlatformSLExtension(TargetPlatform platform) {
212212 FML_UNREACHABLE ();
213213}
214214
215+ std::string ToUtf8 (const std::wstring& wstring) {
216+ std::wstring_convert<std::codecvt_utf8<wchar_t >> myconv;
217+ return myconv.to_bytes (wstring);
218+ }
219+
220+ std::string ToUtf8 (const std::string& string) {
221+ return string;
222+ }
223+
215224} // namespace compiler
216225} // namespace impeller
Original file line number Diff line number Diff line change 44
55#pragma once
66
7+ #include < codecvt>
8+ #include < locale>
79#include < string>
810
911#include " flutter/fml/macros.h"
@@ -54,5 +56,9 @@ spv::ExecutionModel ToExecutionModel(SourceType type);
5456spirv_cross::CompilerMSL::Options::Platform TargetPlatformToMSLPlatform (
5557 TargetPlatform platform);
5658
59+ std::string ToUtf8 (const std::wstring& wstring);
60+
61+ std::string ToUtf8 (const std::string& string);
62+
5763} // namespace compiler
5864} // namespace impeller
Original file line number Diff line number Diff line change 66
77#include < filesystem>
88#include < sstream>
9+ #include < string>
910
1011namespace impeller {
1112namespace compiler {
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ struct TRect {
147147 constexpr std::array<TPoint<T>, 4 > GetTransformedPoints (
148148 const Matrix& transform) const {
149149 auto points = GetPoints ();
150- for (uint i = 0 ; i < points.size (); i++) {
150+ for (int i = 0 ; i < points.size (); i++) {
151151 points[i] = transform * points[i];
152152 }
153153 return points;
Original file line number Diff line number Diff line change 44
55#pragma once
66
7+ #include < algorithm>
78#include < cmath>
89#include < limits>
910#include < ostream>
You can’t perform that action at this time.
0 commit comments