Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
flutter::DlImageGPU Class Referencefinal

#include <display_list_image_gpu.h>

Inheritance diagram for flutter::DlImageGPU:
flutter::DlImage SkRefCnt SkRefCntBase

Public Member Functions

 ~DlImageGPU () 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.
 
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.
 
SkISize dimensions () const override
 
virtual size_t GetApproximateByteSize () const override
 
- Public Member Functions inherited from flutter::DlImage
virtual ~DlImage ()
 
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< 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 20 of file display_list_image_gpu.cc.

20{}

Member Function Documentation

◆ dimensions()

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

Implements flutter::DlImage.

Definition at line 54 of file display_list_image_gpu.cc.

54 {
55 const auto image = skia_image();
57}
SkISize dimensions() const
Definition SkImage.h:297
sk_sp< SkImage > skia_image() const override
If this display list image is meant to be used by the Skia backend, an SkImage instance....
sk_sp< SkImage > image
Definition examples.cpp:29
static constexpr SkISize MakeEmpty()
Definition SkSize.h:22

◆ 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 60 of file display_list_image_gpu.cc.

60 {
61 auto size = sizeof(*this);
62 if (auto image = skia_image()) {
63 const auto& info = image->imageInfo();
64 const auto kMipmapOverhead = image->hasMipmaps() ? 4.0 / 3.0 : 1.0;
65 const size_t image_byte_size = info.computeMinByteSize() * kMipmapOverhead;
66 size += image_byte_size;
67 }
68 return size;
69}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition DM.cpp:213
const SkImageInfo & imageInfo() const
Definition SkImage.h:279
bool hasMipmaps() const
Definition SkImage.cpp:292
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

◆ 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 28 of file display_list_image_gpu.cc.

28 {
29 return nullptr;
30}

◆ 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 33 of file display_list_image_gpu.cc.

33 {
34 if (auto image = skia_image()) {
35 return image->isOpaque();
36 }
37 return false;
38}
bool isOpaque() const
Definition SkImage.h:375

◆ isTextureBacked()

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

Implements flutter::DlImage.

Definition at line 41 of file display_list_image_gpu.cc.

41 {
42 if (auto image = skia_image()) {
43 return image->isTextureBacked();
44 }
45 return false;
46}
virtual bool isTextureBacked() const =0

◆ 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 49 of file display_list_image_gpu.cc.

49 {
50 return true;
51}

◆ Make()

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

Definition at line 9 of file display_list_image_gpu.cc.

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

◆ 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 23 of file display_list_image_gpu.cc.

23 {
24 return image_.skia_object();
25};
sk_sp< SkiaObjectType > skia_object() const

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