#include <image_decoder_impeller.h>
Public Member Functions | |
| 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) | |
| ~ImageDecoderImpeller () override | |
| void | Decode (fml::RefPtr< ImageDescriptor > descriptor, uint32_t target_width, uint32_t target_height, const ImageResult &result) override |
Public Member Functions inherited from flutter::ImageDecoder | |
| virtual | ~ImageDecoder () |
| fml::TaskRunnerAffineWeakPtr< ImageDecoder > | GetWeakPtr () const |
Static Public Member Functions | |
| static DecompressResult | DecompressTexture (ImageDescriptor *descriptor, SkISize target_size, impeller::ISize max_texture_size, bool supports_wide_gamut, const std::shared_ptr< const impeller::Capabilities > &capabilities, const std::shared_ptr< impeller::Allocator > &allocator) |
| static void | UploadTextureToPrivate (ImageResult result, 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::optional< SkImageInfo > &resize_info, const std::shared_ptr< const fml::SyncSwitch > &gpu_disabled_switch) |
| Create a device private texture from the provided host buffer. | |
| static std::pair< sk_sp< DlImage >, std::string > | UploadTextureToStorage (const std::shared_ptr< impeller::Context > &context, std::shared_ptr< SkBitmap > bitmap) |
| Create a texture from the provided bitmap. | |
Static Public Member Functions inherited from flutter::ImageDecoder | |
| static std::unique_ptr< ImageDecoder > | Make (const Settings &settings, const TaskRunners &runners, std::shared_ptr< fml::ConcurrentTaskRunner > concurrent_task_runner, const fml::WeakPtr< IOManager > &io_manager, const std::shared_ptr< fml::SyncSwitch > &gpu_disabled_switch) |
Additional Inherited Members | |
Public Types inherited from flutter::ImageDecoder | |
| using | ImageResult = std::function< void(sk_sp< DlImage >, std::string)> |
Protected Member Functions inherited from flutter::ImageDecoder | |
| ImageDecoder (const TaskRunners &runners, std::shared_ptr< fml::ConcurrentTaskRunner > concurrent_task_runner, fml::WeakPtr< IOManager > io_manager) | |
Protected Attributes inherited from flutter::ImageDecoder | |
| TaskRunners | runners_ |
| std::shared_ptr< fml::ConcurrentTaskRunner > | concurrent_task_runner_ |
| fml::WeakPtr< IOManager > | io_manager_ |
Definition at line 50 of file image_decoder_impeller.h.
| flutter::ImageDecoderImpeller::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 | ||
| ) |
Definition at line 95 of file image_decoder_impeller.cc.
References flutter::TaskRunners::GetIOTaskRunner(), fml::MakeCopyable(), fml::TaskRunner::PostTask(), and flutter::ImageDecoder::runners_.
|
overridedefault |
|
overridevirtual |
Implements flutter::ImageDecoder.
Definition at line 532 of file image_decoder_impeller.cc.
References FML_DCHECK, fml::RefPtr< T >::get(), image, and impeller::Context::kOpenGLES.
|
static |
Definition at line 131 of file image_decoder_impeller.cc.
References alpha_type, flutter::buffer, flutter::ChooseCompatibleAlphaType(), flutter::ChooseCompatibleColorType(), color_type, flutter::ImageDescriptor::data(), flutter::DecompressResult::decode_error, flutter::DecompressResult::device_buffer, FML_DLOG, FML_LOG, flutter::ImageDescriptor::get_pixels(), flutter::ImageDescriptor::get_scaled_dimensions(), impeller::TSize< T >::height, flutter::ImageDescriptor::image_info(), flutter::ImageDescriptor::is_compressed(), flutter::ImageDescriptor::row_bytes(), impeller::ToPixelFormat(), TRACE_EVENT0, and impeller::TSize< T >::width.
Referenced by flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
|
static |
Create a device private texture from the provided host buffer.
| result | The image result closure that accepts the DlImage and any encoding error messages. |
| context | The Impeller graphics context. |
| buffer | A host buffer containing the image to be uploaded. |
| image_info | Format information about the particular image. |
| bitmap | A bitmap containg the image to be uploaded. |
| gpu_disabled_switch | Whether the GPU is available command encoding. |
Definition at line 428 of file image_decoder_impeller.cc.
References flutter::buffer, image, and TRACE_EVENT0.
Referenced by flutter::testing::TEST_F(), and flutter::testing::TEST_F().
|
static |
Create a texture from the provided bitmap.
| context | The Impeller graphics context. |
| bitmap | A bitmap containg the image to be uploaded. |
Definition at line 475 of file image_decoder_impeller.cc.
References FML_DLOG, impeller::TextureDescriptor::format, impeller::TextureDescriptor::GetByteSizeOfBaseMipLevel(), impeller::kHostVisible, impeller::DlImageImpeller::Make(), impeller::TextureDescriptor::mip_count, impeller::TextureDescriptor::size, impeller::TextureDescriptor::storage_mode, texture, impeller::ToPixelFormat(), TRACE_EVENT0, and impeller::TSize< T >::width.
Referenced by flutter::testing::TEST_F().