@@ -4,6 +4,8 @@
|
||||
|
||||
#include "impeller/base/comparable.h"
|
||||
|
||||
#include <atomic>
|
||||
|
||||
namespace impeller {
|
||||
|
||||
static std::atomic_size_t sLastID;
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
|
||||
#include "flutter/fml/macros.h"
|
||||
|
||||
@@ -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()) {
|
||||
|
||||
@@ -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::UniqueFD>(
|
||||
fml::OpenDirectory(std::filesystem::current_path().native().c_str(),
|
||||
false, // create if necessary,
|
||||
fml::FilePermission::kRead))),
|
||||
working_directory(std::make_shared<fml::UniqueFD>(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", "")),
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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<std::codecvt_utf8<wchar_t>> myconv;
|
||||
return myconv.to_bytes(wstring);
|
||||
}
|
||||
|
||||
std::string ToUtf8(const std::string& string) {
|
||||
return string;
|
||||
}
|
||||
|
||||
} // namespace compiler
|
||||
} // namespace impeller
|
||||
|
||||
@@ -4,6 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <codecvt>
|
||||
#include <locale>
|
||||
#include <string>
|
||||
|
||||
#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
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <filesystem>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
namespace impeller {
|
||||
namespace compiler {
|
||||
|
||||
@@ -147,7 +147,7 @@ struct TRect {
|
||||
constexpr std::array<TPoint<T>, 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;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <ostream>
|
||||
|
||||
Reference in New Issue
Block a user