5#ifndef FLUTTER_LIB_UI_PAINTING_IMAGE_DECODER_IMPELLER_H_
6#define FLUTTER_LIB_UI_PAINTING_IMAGE_DECODER_IMPELLER_H_
10#include "flutter/fml/macros.h"
11#include "flutter/lib/ui/painting/image_decoder.h"
36 std::shared_ptr<impeller::Allocator> allocator_;
37 std::shared_ptr<impeller::DeviceBuffer> buffer_;
51 std::shared_ptr<fml::ConcurrentTaskRunner> concurrent_task_runner,
53 bool supports_wide_gamut,
54 const std::shared_ptr<fml::SyncSwitch>& gpu_disabled_switch);
60 uint32_t target_width,
61 uint32_t target_height,
68 bool supports_wide_gamut,
69 const std::shared_ptr<impeller::Allocator>& allocator);
80 const std::shared_ptr<impeller::Context>& context,
81 const std::shared_ptr<impeller::DeviceBuffer>&
buffer,
83 const std::shared_ptr<SkBitmap>&
bitmap,
84 const std::shared_ptr<fml::SyncSwitch>& gpu_disabled_switch);
95 const std::shared_ptr<impeller::Context>& context,
96 std::shared_ptr<SkBitmap>
bitmap,
97 const std::shared_ptr<fml::SyncSwitch>& gpu_disabled_switch,
99 bool create_mips =
true);
102 using FutureContext = std::shared_future<std::shared_ptr<impeller::Context>>;
103 FutureContext context_;
104 const bool supports_wide_gamut_;
105 std::shared_ptr<fml::SyncSwitch> gpu_disabled_switch_;
void Decode(fml::RefPtr< ImageDescriptor > descriptor, uint32_t target_width, uint32_t target_height, const ImageResult &result) override
static std::pair< sk_sp< DlImage >, std::string > UploadTextureToStorage(const std::shared_ptr< impeller::Context > &context, std::shared_ptr< SkBitmap > bitmap, const std::shared_ptr< fml::SyncSwitch > &gpu_disabled_switch, impeller::StorageMode storage_mode, bool create_mips=true)
Create a host visible texture from the provided bitmap.
ImageDecoderImpeller(const TaskRunners &runners, std::shared_ptr< fml::ConcurrentTaskRunner > concurrent_task_runner, const fml::WeakPtr< IOManager > &io_manager, bool supports_wide_gamut, const std::shared_ptr< fml::SyncSwitch > &gpu_disabled_switch)
static std::pair< sk_sp< DlImage >, std::string > UploadTextureToPrivate(const std::shared_ptr< impeller::Context > &context, const std::shared_ptr< impeller::DeviceBuffer > &buffer, const SkImageInfo &image_info, const std::shared_ptr< SkBitmap > &bitmap, const std::shared_ptr< fml::SyncSwitch > &gpu_disabled_switch)
Create a device private texture from the provided host buffer. This method is only suported on the me...
static DecompressResult DecompressTexture(ImageDescriptor *descriptor, SkISize target_size, impeller::ISize max_texture_size, bool supports_wide_gamut, const std::shared_ptr< impeller::Allocator > &allocator)
~ImageDecoderImpeller() override
std::function< void(sk_sp< DlImage >, std::string)> ImageResult
Creates an image descriptor for encoded or decoded image data, describing the width,...
bool allocPixelRef(SkBitmap *bitmap) override
~ImpellerAllocator()=default
ImpellerAllocator(std::shared_ptr< impeller::Allocator > allocator)
std::shared_ptr< impeller::DeviceBuffer > GetDeviceBuffer() const
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
StorageMode
Specified where the allocation resides and how it is used.
std::shared_ptr< SkBitmap > sk_bitmap
std::shared_ptr< impeller::DeviceBuffer > device_buffer