Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
impeller::DlImageImpellerTexture Class Referencefinal

#include <dl_image_impeller.h>

Inheritance diagram for impeller::DlImageImpellerTexture:
impeller::DlImageImpeller flutter::DlImage

Public Member Functions

 DlImageImpellerTexture (std::shared_ptr< Texture > texture, OwningContext owning_context)
 
 ~DlImageImpellerTexture () override
 
std::shared_ptr< TextureGetImpellerTexture (const std::shared_ptr< Context > &context) const override
 
flutter::DlColorSpace GetColorSpace () const override
 Gets the color space of the image.
 
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.
 
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.
 
flutter::DlISize GetSize () const override
 
size_t GetApproximateByteSize () const override
 
OwningContext owning_context () const override
 
- Public Member Functions inherited from impeller::DlImageImpeller
Type GetImageType () const override
 Returns the backend type of this image.
 
const DlImageImpellerasImpellerImage () const override
 Safe downcast to DlImageImpeller.
 
bool isTextureBacked () const override
 Returns true if the image is backed by a GPU texture.
 
std::shared_ptr< TextureGetCachedTexture (const ContentContext &renderer) const
 
- Public Member Functions inherited from flutter::DlImage
virtual ~DlImage ()
 
virtual const DlImageSkiaasSkiaImage () const
 Safe downcast to DlImageSkia.
 
int width () const
 
int height () const
 
DlIRect GetBounds () 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
 

Additional Inherited Members

- Public Types inherited from flutter::DlImage
enum class  OwningContext {
  kRaster ,
  kIO
}
 
enum class  Type {
  kSkia ,
  kImpeller
}
 The backend type of this image. More...
 
- Static Public Member Functions inherited from impeller::DlImageImpeller
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)
 
- Protected Member Functions inherited from flutter::DlImage
 DlImage ()
 

Detailed Description

Definition at line 45 of file dl_image_impeller.h.

Constructor & Destructor Documentation

◆ DlImageImpellerTexture()

impeller::DlImageImpellerTexture::DlImageImpellerTexture ( std::shared_ptr< Texture texture,
OwningContext  owning_context 
)

Definition at line 65 of file dl_image_impeller.cc.

67 : texture_(std::move(texture)), owning_context_(owning_context) {}
OwningContext owning_context() const override
FlTexture * texture

◆ ~DlImageImpellerTexture()

impeller::DlImageImpellerTexture::~DlImageImpellerTexture ( )
overridedefault

Member Function Documentation

◆ GetApproximateByteSize()

size_t impeller::DlImageImpellerTexture::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 112 of file dl_image_impeller.cc.

112 {
113 auto size = sizeof(*this);
114 if (texture_) {
115 size += texture_->GetTextureDescriptor().GetByteSizeOfBaseMipLevel();
116 }
117 return size;
118}
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all 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

◆ GetColorSpace()

flutter::DlColorSpace impeller::DlImageImpellerTexture::GetColorSpace ( ) const
overridevirtual

Gets the color space of the image.

Returns
The color space.

Implements flutter::DlImage.

Definition at line 79 of file dl_image_impeller.cc.

79 {
80 if (!texture_) {
82 }
83 switch (texture_->GetTextureDescriptor().format) {
87 default:
89 }
90}

References impeller::kB10G10R10XR, flutter::kExtendedSRGB, impeller::kR16G16B16A16Float, and flutter::kSRGB.

◆ GetImpellerTexture()

std::shared_ptr< impeller::Texture > impeller::DlImageImpellerTexture::GetImpellerTexture ( const std::shared_ptr< Context > &  context) const
overridevirtual

Implements impeller::DlImageImpeller.

Definition at line 73 of file dl_image_impeller.cc.

74 {
75 return texture_;
76}

◆ GetSize()

flutter::DlISize impeller::DlImageImpellerTexture::GetSize ( ) const
overridevirtual
Returns
The dimensions of the pixel grid.

Implements flutter::DlImage.

Definition at line 105 of file dl_image_impeller.cc.

105 {
106 // texture |GetSize()| returns a 64-bit size, but we need a 32-bit size,
107 // so we need to convert to DlISize (the 32-bit variant) either way.
108 return texture_ ? flutter::DlISize(texture_->GetSize()) : flutter::DlISize();
109}
impeller::ISize32 DlISize

◆ isOpaque()

bool impeller::DlImageImpellerTexture::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 93 of file dl_image_impeller.cc.

93 {
94 // Impeller doesn't currently implement opaque alpha types.
95 return false;
96}

◆ isUIThreadSafe()

bool impeller::DlImageImpellerTexture::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 99 of file dl_image_impeller.cc.

99 {
100 // Impeller textures are always thread-safe
101 return true;
102}

◆ owning_context()

OwningContext impeller::DlImageImpellerTexture::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 61 of file dl_image_impeller.h.

61{ return owning_context_; }

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