#include <includer.h>
Definition at line 25 of file includer.h.
◆ Includer()
impeller::compiler::Includer::Includer |
( |
std::shared_ptr< fml::UniqueFD > |
working_directory, |
|
|
std::vector< IncludeDir > |
include_dirs, |
|
|
std::function< void(std::string)> |
on_file_included |
|
) |
| |
Definition at line 14 of file includer.cc.
17 : working_directory_(std::move(working_directory)),
19 on_file_included_(std::move(on_file_included)) {}
◆ ~Includer()
impeller::compiler::Includer::~Includer |
( |
| ) |
|
|
overridedefault |
◆ GetInclude()
shaderc_include_result * impeller::compiler::Includer::GetInclude |
( |
const char * |
requested_source, |
|
|
shaderc_include_type |
type, |
|
|
const char * |
requesting_source, |
|
|
size_t |
include_depth |
|
) |
| |
|
override |
Definition at line 71 of file includer.cc.
74 {
75 auto result = std::make_unique<shaderc_include_result>();
76
77
79 result->source_name_length = 0;
80
81 constexpr const char* kFileNotFoundMessage = "Included file not found.";
82 result->content = kFileNotFoundMessage;
83 result->content_length = ::strlen(kFileNotFoundMessage);
84 result->user_data =
nullptr;
85
86 if (!working_directory_ || !working_directory_->is_valid()) {
88 }
89
90 if (requested_source == nullptr) {
92 }
93
94 auto file = FindFirstMapping(requested_source);
95
96 if (!
file ||
file->GetMapping() ==
nullptr) {
98 }
99
100 auto includer_data =
101 std::make_unique<IncluderData>(requested_source, std::move(
file));
102
103 result->source_name = includer_data->file_name.c_str();
104 result->source_name_length = includer_data->file_name.length();
106 includer_data->mapping->GetMapping());
107 result->content_length = includer_data->mapping->GetSize();
108 result->user_data = includer_data.release();
109
111}
union flutter::testing::@2836::KeyboardChange::@76 content
◆ ReleaseInclude()
void impeller::compiler::Includer::ReleaseInclude |
( |
shaderc_include_result * |
data | ) |
|
|
override |
Definition at line 113 of file includer.cc.
113 {
114 delete reinterpret_cast<IncluderData*
>(
data->user_data);
116}
std::shared_ptr< const fml::Mapping > data
The documentation for this class was generated from the following files: