Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
impeller::DlImageImpeller Class Referencefinal

#include <dl_image_impeller.h>

Inheritance diagram for impeller::DlImageImpeller:
flutter::DlImage SkRefCnt SkRefCntBase

Public Member Functions

 ~DlImageImpeller () override
 
sk_sp< SkImageskia_image () const override
 If this display list image is meant to be used by the Skia backend, an SkImage instance. Null otherwise. More...
 
std::shared_ptr< impeller::Textureimpeller_texture () const override
 If this display list image is meant to be used by the Impeller backend, an Impeller texture instance. Null otherwise. More...
 
bool isOpaque () const override
 If the pixel format of this image ignores alpha, this returns true. This method might conservatively return false when it cannot guarnatee an opaque image, for example when the pixel format of the image supports alpha but the image is made up of entirely opaque pixels. More...
 
bool isTextureBacked () const override
 
bool isUIThreadSafe () const override
 If the underlying platform image held by this object has no threading requirements for the release of that image (or if arrangements have already been made to forward that image to the correct thread upon deletion), this method returns true. More...
 
SkISize dimensions () const override
 
size_t GetApproximateByteSize () const override
 
OwningContext owning_context () const override
 
- Public Member Functions inherited from flutter::DlImage
virtual ~DlImage ()
 
virtual sk_sp< SkImageskia_image () const =0
 If this display list image is meant to be used by the Skia backend, an SkImage instance. Null otherwise. More...
 
virtual std::shared_ptr< impeller::Textureimpeller_texture () const =0
 If this display list image is meant to be used by the Impeller backend, an Impeller texture instance. Null otherwise. More...
 
virtual bool isOpaque () const =0
 If the pixel format of this image ignores alpha, this returns true. This method might conservatively return false when it cannot guarnatee an opaque image, for example when the pixel format of the image supports alpha but the image is made up of entirely opaque pixels. More...
 
virtual bool isTextureBacked () const =0
 
virtual bool isUIThreadSafe () const =0
 If the underlying platform image held by this object has no threading requirements for the release of that image (or if arrangements have already been made to forward that image to the correct thread upon deletion), this method returns true. More...
 
virtual SkISize dimensions () const =0
 
virtual size_t GetApproximateByteSize () const =0
 
int width () const
 
int height () const
 
SkIRect bounds () const
 
virtual OwningContext owning_context () const
 
virtual std::optional< std::string > get_error () const
 
bool Equals (const DlImage *other) const
 
bool Equals (const DlImage &other) const
 
bool Equals (const sk_sp< const DlImage > &other) const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static sk_sp< DlImageImpellerMake (std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
 
static sk_sp< DlImageImpellerMakeFromYUVTextures (AiksContext *aiks_context, std::shared_ptr< Texture > y_texture, std::shared_ptr< Texture > uv_texture, YUVColorSpace yuv_color_space)
 
- Static Public Member Functions inherited from flutter::DlImage
static sk_sp< DlImageMake (const SkImage *image)
 
static sk_sp< DlImageMake (sk_sp< SkImage > image)
 

Additional Inherited Members

- Public Types inherited from flutter::DlImage
enum class  OwningContext { kRaster , kIO }
 
- Protected Member Functions inherited from flutter::DlImage
 DlImage ()
 

Detailed Description

Definition at line 15 of file dl_image_impeller.h.

Constructor & Destructor Documentation

◆ ~DlImageImpeller()

impeller::DlImageImpeller::~DlImageImpeller ( )
overridedefault

Member Function Documentation

◆ dimensions()

SkISize impeller::DlImageImpeller::dimensions ( ) const
overridevirtual
Returns
The dimensions of the pixel grid.

Implements flutter::DlImage.

Definition at line 83 of file dl_image_impeller.cc.

83 {
84 const auto size = texture_ ? texture_->GetSize() : ISize{};
85 return SkISize::Make(size.width, size.height);
86}
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
ISize64 ISize
Definition: size.h:140
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ GetApproximateByteSize()

size_t impeller::DlImageImpeller::GetApproximateByteSize ( ) const
overridevirtual
Returns
The approximate byte size of the allocation of this image. This takes into account details such as mip-mapping. The allocation is usually resident in device memory.

Implements flutter::DlImage.

Definition at line 89 of file dl_image_impeller.cc.

89 {
90 auto size = sizeof(*this);
91 if (texture_) {
92 size += texture_->GetTextureDescriptor().GetByteSizeOfBaseMipLevel();
93 }
94 return size;
95}

◆ impeller_texture()

std::shared_ptr< impeller::Texture > impeller::DlImageImpeller::impeller_texture ( ) const
overridevirtual

If this display list image is meant to be used by the Impeller backend, an Impeller texture instance. Null otherwise.

Returns
An Impeller texture instance or null.

Implements flutter::DlImage.

Definition at line 60 of file dl_image_impeller.cc.

60 {
61 return texture_;
62}

◆ isOpaque()

bool impeller::DlImageImpeller::isOpaque ( ) const
overridevirtual

If the pixel format of this image ignores alpha, this returns true. This method might conservatively return false when it cannot guarnatee an opaque image, for example when the pixel format of the image supports alpha but the image is made up of entirely opaque pixels.

Returns
True if the pixel format of this image ignores alpha.

Implements flutter::DlImage.

Definition at line 65 of file dl_image_impeller.cc.

65 {
66 // Impeller doesn't currently implement opaque alpha types.
67 return false;
68}

◆ isTextureBacked()

bool impeller::DlImageImpeller::isTextureBacked ( ) const
overridevirtual

Implements flutter::DlImage.

Definition at line 71 of file dl_image_impeller.cc.

71 {
72 // Impeller textures are always ... textures :/
73 return true;
74}

◆ isUIThreadSafe()

bool impeller::DlImageImpeller::isUIThreadSafe ( ) const
overridevirtual

If the underlying platform image held by this object has no threading requirements for the release of that image (or if arrangements have already been made to forward that image to the correct thread upon deletion), this method returns true.

Returns
True if the underlying image is held in a thread-safe manner.

Implements flutter::DlImage.

Definition at line 77 of file dl_image_impeller.cc.

77 {
78 // Impeller textures are always thread-safe
79 return true;
80}

◆ Make()

sk_sp< DlImageImpeller > impeller::DlImageImpeller::Make ( std::shared_ptr< Texture texture,
OwningContext  owning_context = OwningContext::kIO 
)
static

Definition at line 12 of file dl_image_impeller.cc.

13 {
14 if (!texture) {
15 return nullptr;
16 }
18 new DlImageImpeller(std::move(texture), owning_context));
19}
OwningContext owning_context() const override
FlTexture * texture

◆ MakeFromYUVTextures()

sk_sp< DlImageImpeller > impeller::DlImageImpeller::MakeFromYUVTextures ( AiksContext aiks_context,
std::shared_ptr< Texture y_texture,
std::shared_ptr< Texture uv_texture,
YUVColorSpace  yuv_color_space 
)
static

Definition at line 21 of file dl_image_impeller.cc.

25 {
26 if (!aiks_context || !y_texture || !uv_texture) {
27 return nullptr;
28 }
29 auto yuv_to_rgb_filter_contents = FilterContents::MakeYUVToRGBFilter(
30 std::move(y_texture), std::move(uv_texture), yuv_color_space);
31 impeller::Entity entity;
33 auto snapshot = yuv_to_rgb_filter_contents->RenderToSnapshot(
34 aiks_context->GetContentContext(), // renderer
35 entity, // entity
36 std::nullopt, // coverage_limit
37 std::nullopt, // sampler_descriptor
38 true, // msaa_enabled
39 /*mip_count=*/1,
40 "MakeYUVToRGBFilter Snapshot"); // label
41 if (!snapshot.has_value()) {
42 return nullptr;
43 }
44 return impeller::DlImageImpeller::Make(snapshot->texture);
45}
static sk_sp< DlImageImpeller > Make(std::shared_ptr< Texture > texture, OwningContext owning_context=OwningContext::kIO)
void SetBlendMode(BlendMode blend_mode)
Definition: entity.cc:115
static std::shared_ptr< FilterContents > MakeYUVToRGBFilter(std::shared_ptr< Texture > y_texture, std::shared_ptr< Texture > uv_texture, YUVColorSpace yuv_color_space)

◆ owning_context()

OwningContext impeller::DlImageImpeller::owning_context ( ) const
inlineoverridevirtual
Returns
Specifies which context was used to create this image. The image must be collected on the same task runner as its context.

Reimplemented from flutter::DlImage.

Definition at line 52 of file dl_image_impeller.h.

52{ return owning_context_; }

◆ skia_image()

sk_sp< SkImage > impeller::DlImageImpeller::skia_image ( ) const
overridevirtual

If this display list image is meant to be used by the Skia backend, an SkImage instance. Null otherwise.

Returns
A Skia image instance or null.

Implements flutter::DlImage.

Definition at line 55 of file dl_image_impeller.cc.

55 {
56 return nullptr;
57};

The documentation for this class was generated from the following files: