File tree 10 files changed +30
-9
lines changed
10 files changed +30
-9
lines changed Original file line number Diff line number Diff line change 4
4
5
5
#include " impeller/base/comparable.h"
6
6
7
+ #include < atomic>
8
+
7
9
namespace impeller {
8
10
9
11
static std::atomic_size_t sLastID ;
Original file line number Diff line number Diff line change 5
5
#pragma once
6
6
7
7
#include < memory>
8
+ #include < mutex>
8
9
#include < thread>
9
10
10
11
#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) {
52
52
reflector_options.shader_name =
53
53
InferShaderNameFromPath (switches.source_file_name );
54
54
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 () );
58
58
59
59
Compiler compiler (*source_file_mapping, options, reflector_options);
60
60
if (!compiler.IsValid ()) {
Original file line number Diff line number Diff line change @@ -62,10 +62,10 @@ static TargetPlatform TargetPlatformFromCommandLine(
62
62
63
63
Switches::Switches (const fml::CommandLine& command_line)
64
64
: 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))),
69
69
source_file_name(command_line.GetOptionValueWithDefault(" input" , " " )),
70
70
sl_file_name(command_line.GetOptionValueWithDefault(" sl" , " " )),
71
71
spirv_file_name(command_line.GetOptionValueWithDefault(" spirv" , " " )),
Original file line number Diff line number Diff line change 12
12
#include " flutter/fml/unique_fd.h"
13
13
#include " impeller/compiler/compiler.h"
14
14
#include " impeller/compiler/include_dir.h"
15
+ #include " impeller/compiler/types.h"
15
16
16
17
namespace impeller {
17
18
namespace compiler {
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ static std::string UniqueEntryPointFunctionNameFromSourceName(
60
60
SourceType type) {
61
61
std::stringstream stream;
62
62
std::filesystem::path file_path (file_name);
63
- stream << file_path.stem ().native () << " _" ;
63
+ stream << ToUtf8 ( file_path.stem ().native () ) << " _" ;
64
64
switch (type) {
65
65
case SourceType::kUnknown :
66
66
stream << " unknown" ;
@@ -212,5 +212,14 @@ std::string TargetPlatformSLExtension(TargetPlatform platform) {
212
212
FML_UNREACHABLE ();
213
213
}
214
214
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
+
215
224
} // namespace compiler
216
225
} // namespace impeller
Original file line number Diff line number Diff line change 4
4
5
5
#pragma once
6
6
7
+ #include < codecvt>
8
+ #include < locale>
7
9
#include < string>
8
10
9
11
#include " flutter/fml/macros.h"
@@ -54,5 +56,9 @@ spv::ExecutionModel ToExecutionModel(SourceType type);
54
56
spirv_cross::CompilerMSL::Options::Platform TargetPlatformToMSLPlatform (
55
57
TargetPlatform platform);
56
58
59
+ std::string ToUtf8 (const std::wstring& wstring);
60
+
61
+ std::string ToUtf8 (const std::string& string);
62
+
57
63
} // namespace compiler
58
64
} // namespace impeller
Original file line number Diff line number Diff line change 6
6
7
7
#include < filesystem>
8
8
#include < sstream>
9
+ #include < string>
9
10
10
11
namespace impeller {
11
12
namespace compiler {
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ struct TRect {
147
147
constexpr std::array<TPoint<T>, 4 > GetTransformedPoints (
148
148
const Matrix& transform) const {
149
149
auto points = GetPoints ();
150
- for (uint i = 0 ; i < points.size (); i++) {
150
+ for (int i = 0 ; i < points.size (); i++) {
151
151
points[i] = transform * points[i];
152
152
}
153
153
return points;
Original file line number Diff line number Diff line change 4
4
5
5
#pragma once
6
6
7
+ #include < algorithm>
7
8
#include < cmath>
8
9
#include < limits>
9
10
#include < ostream>
You can’t perform that action at this time.
0 commit comments