22 std::shared_ptr<Texture> y_texture,
23 std::shared_ptr<Texture> uv_texture,
25 if (!aiks_context || !y_texture || !uv_texture) {
29 std::move(y_texture), std::move(uv_texture), yuv_color_space);
38 [&] { renderer.GetRenderTargetCache()->EnableCache(); });
40 std::optional<Snapshot> snapshot =
41 yuv_to_rgb_filter_contents->RenderToSnapshot(
43 {.coverage_limit = std::nullopt,
44 .sampler_descriptor = std::nullopt,
47 .label =
"MakeYUVToRGBFilter Snapshot"});
48 if (!snapshot.has_value()) {
67 : texture_(
std::move(
texture)), owning_context_(owning_context) {}
74 const std::shared_ptr<impeller::Context>& context)
const {
83 switch (texture_->GetTextureDescriptor().format) {
113 auto size =
sizeof(*this);
115 size += texture_->GetTextureDescriptor().GetByteSizeOfBaseMipLevel();
virtual OwningContext owning_context() const
Wraps a closure that is invoked in the destructor unless released by the caller.
ContentContext & GetContentContext() const
std::shared_ptr< Texture > GetCachedTexture(const flutter::DlImage *image) const
Get a cached texture for the given image.
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache() const
void SetCachedTexture(const flutter::DlImage *image, const std::shared_ptr< Texture > &texture) const
Set a cached texture for the given image.
std::shared_ptr< Context > GetContext() const
std::shared_ptr< Texture > GetCachedTexture(const ContentContext &renderer) const
virtual std::shared_ptr< Texture > GetImpellerTexture(const std::shared_ptr< Context > &context) const =0
static sk_sp< DlImageImpeller > MakeFromYUVTextures(AiksContext *aiks_context, std::shared_ptr< Texture > y_texture, std::shared_ptr< Texture > uv_texture, YUVColorSpace yuv_color_space)
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
flutter::DlColorSpace GetColorSpace() const override
Gets the color space of the image.
DlImageImpellerTexture(std::shared_ptr< Texture > texture, OwningContext owning_context)
~DlImageImpellerTexture() override
bool isUIThreadSafe() const override
If the underlying platform image held by this object has no threading requirements for the release of...
flutter::DlISize GetSize() const override
bool isOpaque() const override
If the pixel format of this image ignores alpha, this returns true. This method might conservatively ...
std::shared_ptr< Texture > GetImpellerTexture(const std::shared_ptr< Context > &context) const override
size_t GetApproximateByteSize() const override
void SetBlendMode(BlendMode blend_mode)
static std::shared_ptr< FilterContents > MakeYUVToRGBFilter(std::shared_ptr< Texture > y_texture, std::shared_ptr< Texture > uv_texture, YUVColorSpace yuv_color_space)
impeller::ISize32 DlISize