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

#include <display_list_image_gpu.h>

Inheritance diagram for flutter::DlImageGPU:
flutter::DlImage

Public Member Functions

 ~DlImageGPU () 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
 
virtual 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
 

Static Public Member Functions

static sk_sp< DlImageGPUMake (SkiaGPUObject< SkImage > image)
 
- 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 14 of file display_list_image_gpu.h.

Constructor & Destructor Documentation

◆ ~DlImageGPU()

flutter::DlImageGPU::~DlImageGPU ( )
override

Definition at line 22 of file display_list_image_gpu.cc.

22{}

Member Function Documentation

◆ GetApproximateByteSize()

size_t flutter::DlImageGPU::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 62 of file display_list_image_gpu.cc.

62 {
63 auto size = sizeof(*this);
64 if (auto image = skia_image()) {
65 const auto& info = image->imageInfo();
66 const auto kMipmapOverhead = image->hasMipmaps() ? 4.0 / 3.0 : 1.0;
67 const size_t image_byte_size = info.computeMinByteSize() * kMipmapOverhead;
68 size += image_byte_size;
69 }
70 return size;
71}
sk_sp< SkImage > skia_image() const override
If this display list image is meant to be used by the Skia backend, an SkImage instance....
FlutterVulkanImage * image
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 image, flutter::size, and skia_image().

◆ GetSize()

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

Implements flutter::DlImage.

Definition at line 56 of file display_list_image_gpu.cc.

56 {
57 const auto image = skia_image();
58 return image ? ToDlISize(image->dimensions()) : DlISize();
59}
const DlISize & ToDlISize(const SkISize &size)
impeller::ISize32 DlISize

References image, skia_image(), and flutter::ToDlISize().

◆ impeller_texture()

std::shared_ptr< impeller::Texture > flutter::DlImageGPU::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 30 of file display_list_image_gpu.cc.

30 {
31 return nullptr;
32}

◆ isOpaque()

bool flutter::DlImageGPU::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 35 of file display_list_image_gpu.cc.

35 {
36 if (auto image = skia_image()) {
37 return image->isOpaque();
38 }
39 return false;
40}

References image, and skia_image().

◆ isTextureBacked()

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

Implements flutter::DlImage.

Definition at line 43 of file display_list_image_gpu.cc.

43 {
44 if (auto image = skia_image()) {
45 return image->isTextureBacked();
46 }
47 return false;
48}

References image, and skia_image().

◆ isUIThreadSafe()

bool flutter::DlImageGPU::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 51 of file display_list_image_gpu.cc.

51 {
52 return true;
53}

◆ Make()

sk_sp< DlImageGPU > flutter::DlImageGPU::Make ( SkiaGPUObject< SkImage >  image)
static

Definition at line 11 of file display_list_image_gpu.cc.

11 {
12 if (!image.skia_object()) {
13 return nullptr;
14 }
15 return sk_sp<DlImageGPU>(new DlImageGPU(std::move(image)));
16}

References image.

Referenced by flutter::ImageDecoderSkia::Decode(), and flutter::Picture::DoRasterizeToImage().

◆ skia_image()

sk_sp< SkImage > flutter::DlImageGPU::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 25 of file display_list_image_gpu.cc.

25 {
26 return image_.skia_object();
27};
sk_sp< SkiaObjectType > skia_object() const

References flutter::SkiaGPUObject< T >::skia_object().

Referenced by GetApproximateByteSize(), GetSize(), isOpaque(), and isTextureBacked().


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