Flutter Engine
 
Loading...
Searching...
No Matches
flutter::DlImageSkia Class Referencefinal

#include <dl_image_skia.h>

Inheritance diagram for flutter::DlImageSkia:
flutter::DlImage

Public Member Functions

 DlImageSkia (sk_sp< SkImage > image)
 
 ~DlImageSkia () override
 
sk_sp< SkImage > skia_image () const override
 If this display list image is meant to be used by the Skia backend, an SkImage instance. Null otherwise.
 
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.
 
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 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.
 
DlISize GetSize () const override
 
size_t GetApproximateByteSize () const override
 
- Public Member Functions inherited from flutter::DlImage
virtual ~DlImage ()
 
int width () const
 
int height () const
 
DlIRect GetBounds () 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
 

Additional Inherited Members

- Public Types inherited from flutter::DlImage
enum class  OwningContext {
  kRaster ,
  kIO
}
 
- Static Public Member Functions inherited from flutter::DlImage
static sk_sp< DlImageMake (const SkImage *image)
 
static sk_sp< DlImageMake (sk_sp< SkImage > image)
 
- Protected Member Functions inherited from flutter::DlImage
 DlImage ()
 

Detailed Description

Definition at line 13 of file dl_image_skia.h.

Constructor & Destructor Documentation

◆ DlImageSkia()

flutter::DlImageSkia::DlImageSkia ( sk_sp< SkImage >  image)
explicit

Definition at line 11 of file dl_image_skia.cc.

11: image_(std::move(image)) {}
FlutterVulkanImage * image

◆ ~DlImageSkia()

flutter::DlImageSkia::~DlImageSkia ( )
overridedefault

Member Function Documentation

◆ GetApproximateByteSize()

size_t flutter::DlImageSkia::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 53 of file dl_image_skia.cc.

53 {
54 auto size = sizeof(*this);
55 if (image_) {
56 const auto& info = image_->imageInfo();
57 const auto kMipmapOverhead = image_->hasMipmaps() ? 4.0 / 3.0 : 1.0;
58 const size_t image_byte_size = info.computeMinByteSize() * kMipmapOverhead;
59 size += image_byte_size;
60 }
61 return size;
62}
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

References flutter::size.

◆ GetSize()

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

Implements flutter::DlImage.

Definition at line 48 of file dl_image_skia.cc.

48 {
49 return image_ ? ToDlISize(image_->dimensions()) : DlISize();
50}
const DlISize & ToDlISize(const SkISize &size)
impeller::ISize32 DlISize

References flutter::ToDlISize().

◆ impeller_texture()

std::shared_ptr< impeller::Texture > flutter::DlImageSkia::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 22 of file dl_image_skia.cc.

22 {
23 return nullptr;
24}

◆ isOpaque()

bool flutter::DlImageSkia::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 27 of file dl_image_skia.cc.

27 {
28 return image_ ? image_->isOpaque() : false;
29}

◆ isTextureBacked()

bool flutter::DlImageSkia::isTextureBacked ( ) const
overridevirtual

Implements flutter::DlImage.

Definition at line 32 of file dl_image_skia.cc.

32 {
33 return image_ ? image_->isTextureBacked() : false;
34}

◆ isUIThreadSafe()

bool flutter::DlImageSkia::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 37 of file dl_image_skia.cc.

37 {
38 // Technically if the image is null then we are thread-safe, and possibly
39 // if the image is constructed from a heap raster as well, but there
40 // should never be a leak of an instance of this class into any data that
41 // is shared with the UI thread, regardless of value.
42 // All images intended to be shared with the UI thread should be constructed
43 // via one of the DlImage subclasses designed for that purpose.
44 return false;
45}

◆ skia_image()

sk_sp< SkImage > flutter::DlImageSkia::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 17 of file dl_image_skia.cc.

17 {
18 return image_;
19};

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