5#ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_GENERATOR_REGISTRY_H_
6#define FLUTTER_LIB_UI_PAINTING_IMAGE_GENERATOR_REGISTRY_H_
22 std::function<std::shared_ptr<ImageGenerator>(sk_sp<SkData> buffer)>;
59 const sk_sp<SkData>& buffer);
64 struct PrioritizedFactory {
69 size_t ascending_nonce = 0;
73 constexpr bool operator()(
const PrioritizedFactory& lhs,
74 const PrioritizedFactory& rhs)
const {
77 if (lhs.priority == rhs.priority) {
78 return lhs.ascending_nonce < rhs.ascending_nonce;
81 return lhs.priority > rhs.priority;
85 using FactorySet = std::set<PrioritizedFactory, Compare>;
86 FactorySet image_generator_factories_;
Keeps a priority-ordered registry of image generator builders to be used when decoding images....
fml::TaskRunnerAffineWeakPtr< ImageGeneratorRegistry > GetWeakPtr() const
~ImageGeneratorRegistry()
std::shared_ptr< ImageGenerator > CreateCompatibleGenerator(const sk_sp< SkData > &buffer)
Walks the list of image generator builders in descending priority order until a compatible ImageGener...
void AddFactory(ImageGeneratorFactory factory, int32_t priority)
Install a new factory for image generators.
FlutterDesktopBinaryReply callback
std::function< std::shared_ptr< ImageGenerator >(sk_sp< SkData > buffer)> ImageGeneratorFactory
ImageGeneratorFactory is the top level primitive for specifying an image decoder in Flutter....