#include <blob_library.h>
Definition at line 18 of file blob_library.h.
◆ BlobLibrary() [1/2]
| impeller::BlobLibrary::BlobLibrary |
( |
std::shared_ptr< fml::Mapping > |
payload | ) |
|
|
explicit |
Definition at line 28 of file blob_library.cc.
29 : payload_(std::move(payload)) {
30 if (!payload_ || payload_->GetMapping() ==
nullptr) {
35 if (!fb::BlobLibraryBufferHasIdentifier(payload_->GetMapping())) {
40 auto blob_library = fb::GetBlobLibrary(payload_->GetMapping());
45 if (
auto items = blob_library->items()) {
46 for (
auto i = items->begin(), end = items->end(); i != end; i++) {
48 key.name = i->name()->str();
50 blobs_[key] = std::make_shared<fml::NonOwnedMapping>(
51 i->mapping()->Data(), i->mapping()->size(),
52 [payload = payload_](
auto,
auto) {
References impeller::ToShaderType(), and VALIDATION_LOG.
◆ BlobLibrary() [2/2]
◆ ~BlobLibrary()
| impeller::BlobLibrary::~BlobLibrary |
( |
| ) |
|
|
default |
◆ GetMapping()
| std::shared_ptr< fml::Mapping > impeller::BlobLibrary::GetMapping |
( |
BlobShaderType |
type, |
|
|
std::string |
name |
|
) |
| const |
Definition at line 74 of file blob_library.cc.
78 key.name = std::move(name);
79 auto found = blobs_.find(key);
80 return found == blobs_.end() ? nullptr : found->second;
Referenced by impeller::testing::TEST().
◆ GetShaderCount()
| size_t impeller::BlobLibrary::GetShaderCount |
( |
| ) |
const |
◆ IsValid()
| bool impeller::BlobLibrary::IsValid |
( |
| ) |
const |
◆ IterateAllBlobs()
| size_t impeller::BlobLibrary::IterateAllBlobs |
( |
const std::function< bool(BlobShaderType type, const std::string &name, const std::shared_ptr< fml::Mapping > &mapping)> & |
callback | ) |
const |
Definition at line 83 of file blob_library.cc.
92 for (
const auto& blob : blobs_) {
94 if (!callback(blob.first.type, blob.first.name, blob.second)) {
References IsValid().
The documentation for this class was generated from the following files: