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

#include <pixel_deferred_image_gpu_impeller.h>

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

Public Member Functions

 ~PixelDeferredImageGPUImpeller () override
 
std::shared_ptr< impeller::TextureGetImpellerTexture (const std::shared_ptr< impeller::Context > &context) const override
 
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.
 
DlISize GetSize () const override
 
size_t GetApproximateByteSize () const override
 
DlColorSpace GetColorSpace () const override
 Gets the color space of the image.
 
std::optional< std::string > get_error () 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.
 
virtual std::shared_ptr< TextureGetImpellerTexture (const std::shared_ptr< Context > &context) const =0
 
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 OwningContext owning_context () 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< PixelDeferredImageGPUImpellerMake (sk_sp< SkImage > image, fml::TaskRunnerAffineWeakPtr< SnapshotDelegate > snapshot_delegate, fml::RefPtr< fml::TaskRunner > raster_task_runner)
 
- 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)
 

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...
 
- Protected Member Functions inherited from flutter::DlImage
 DlImage ()
 

Detailed Description

A deferred image that is created from pixels.

See also
DisplayListDeferredImageGPUImpeller for another example of a deferred image.
dart:ui decodeImageFromPixelsSync for the user of this class.

Definition at line 27 of file pixel_deferred_image_gpu_impeller.h.

Constructor & Destructor Documentation

◆ ~PixelDeferredImageGPUImpeller()

flutter::PixelDeferredImageGPUImpeller::~PixelDeferredImageGPUImpeller ( )
overridedefault

References texture.

Member Function Documentation

◆ get_error()

std::optional< std::string > flutter::PixelDeferredImageGPUImpeller::get_error ( ) const
overridevirtual
Returns
An error, if any, that occurred when trying to create the image.

Reimplemented from flutter::DlImage.

Definition at line 80 of file pixel_deferred_image_gpu_impeller.cc.

80 {
81 return wrapper_ ? wrapper_->get_error() : std::nullopt;
82}

◆ GetApproximateByteSize()

size_t flutter::PixelDeferredImageGPUImpeller::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 49 of file pixel_deferred_image_gpu_impeller.cc.

49 {
50 auto size = sizeof(PixelDeferredImageGPUImpeller);
51 if (wrapper_) {
52 if (wrapper_->texture()) {
53 size += wrapper_->texture()
54 ->GetTextureDescriptor()
55 .GetByteSizeOfBaseMipLevel();
56 } else {
57 size += wrapper_->size().Area() * 4;
58 }
59 }
60 return size;
61}
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.

◆ GetColorSpace()

flutter::DlColorSpace flutter::PixelDeferredImageGPUImpeller::GetColorSpace ( ) const
overridevirtual

Gets the color space of the image.

Returns
The color space.

Implements flutter::DlImage.

Definition at line 63 of file pixel_deferred_image_gpu_impeller.cc.

63 {
64 if (!wrapper_) {
66 }
67 std::shared_ptr<impeller::Texture> texture = wrapper_->texture();
68 if (!texture) {
70 }
71 switch (texture->GetTextureDescriptor().format) {
75 default:
77 }
78}
FlTexture * texture

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

◆ GetImpellerTexture()

std::shared_ptr< impeller::Texture > flutter::PixelDeferredImageGPUImpeller::GetImpellerTexture ( const std::shared_ptr< impeller::Context > &  context) const
override

Definition at line 29 of file pixel_deferred_image_gpu_impeller.cc.

30 {
31 if (!wrapper_) {
32 return nullptr;
33 }
34 return wrapper_->texture();
35}

◆ GetSize()

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

Implements flutter::DlImage.

Definition at line 45 of file pixel_deferred_image_gpu_impeller.cc.

45 {
46 return wrapper_ ? wrapper_->size() : DlISize();
47}
impeller::ISize32 DlISize

◆ isOpaque()

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

37 {
38 return false;
39}

◆ isUIThreadSafe()

bool flutter::PixelDeferredImageGPUImpeller::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 41 of file pixel_deferred_image_gpu_impeller.cc.

41 {
42 return true;
43}

◆ Make()

sk_sp< PixelDeferredImageGPUImpeller > flutter::PixelDeferredImageGPUImpeller::Make ( sk_sp< SkImage >  image,
fml::TaskRunnerAffineWeakPtr< SnapshotDelegate snapshot_delegate,
fml::RefPtr< fml::TaskRunner raster_task_runner 
)
static

Definition at line 12 of file pixel_deferred_image_gpu_impeller.cc.

15 {
16 return sk_sp<PixelDeferredImageGPUImpeller>(new PixelDeferredImageGPUImpeller(
17 PixelDeferredImageGPUImpeller::ImageWrapper::Make(
18 std::move(image), std::move(snapshot_delegate),
19 std::move(raster_task_runner))));
20}
FlutterVulkanImage * image

References image.


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