Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
Skwasm::DlWimpImageBase Class Reference
Inheritance diagram for Skwasm::DlWimpImageBase:
impeller::DlImageImpeller flutter::DlImage Skwasm::DlWimpImageFromPicture Skwasm::DlWimpImageFromPixels Skwasm::DlWimpImageFromTexture

Public Member Functions

 DlWimpImageBase (int width, int height)
 
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.
 
flutter::DlColorSpace GetColorSpace () const override
 Gets the color space of the image.
 
virtual ~DlWimpImageBase ()
 
flutter::DlISize GetSize () const override
 
size_t GetApproximateByteSize () 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 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
 

Protected Attributes

int width_
 
int height_
 

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 30 of file images_impeller.cc.

Constructor & Destructor Documentation

◆ DlWimpImageBase()

Skwasm::DlWimpImageBase::DlWimpImageBase ( int  width,
int  height 
)
inline

◆ ~DlWimpImageBase()

Skwasm::DlWimpImageBase::~DlWimpImageBase ( )
virtual

Definition at line 61 of file images_impeller.cc.

61 {
62 if (emscripten_wasm_worker_self_id() == GetRasterThread()) {
64 } else {
66 }
67}
void skwasm_disposeDlImageOnWorker(void *dl_image_ptr)
void skwasm_dispatchDisposeDlImage(unsigned long thread_id, void *pointer)
unsigned long GetRasterThread()
Definition surface.cc:44

References Skwasm::GetRasterThread(), skwasm_dispatchDisposeDlImage(), and skwasm_disposeDlImageOnWorker().

Member Function Documentation

◆ GetApproximateByteSize()

size_t Skwasm::DlWimpImageBase::GetApproximateByteSize ( ) const
inlineoverridevirtual
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 52 of file images_impeller.cc.

52 {
53 return width_ * height_ * 4;
54 }

References height_, and width_.

◆ GetColorSpace()

flutter::DlColorSpace Skwasm::DlWimpImageBase::GetColorSpace ( ) const
inlineoverridevirtual

Gets the color space of the image.

Returns
The color space.

Implements flutter::DlImage.

Definition at line 42 of file images_impeller.cc.

References flutter::kSRGB.

◆ GetImpellerTexture()

std::shared_ptr< impeller::Texture > Skwasm::DlWimpImageBase::GetImpellerTexture ( const std::shared_ptr< impeller::Context > &  context) const
inlineoverridevirtual

Implements impeller::DlImageImpeller.

Reimplemented in Skwasm::DlWimpImageFromTexture, Skwasm::DlWimpImageFromPixels, and Skwasm::DlWimpImageFromPicture.

Definition at line 35 of file images_impeller.cc.

36 {
37 return nullptr;
38 }

◆ GetSize()

flutter::DlISize Skwasm::DlWimpImageBase::GetSize ( ) const
inlineoverridevirtual
Returns
The dimensions of the pixel grid.

Implements flutter::DlImage.

Definition at line 48 of file images_impeller.cc.

48 {
50 }
static constexpr TSize MakeWH(Type width, Type height)
Definition size.h:43

References height_, impeller::TSize< T >::MakeWH(), and width_.

◆ isOpaque()

bool Skwasm::DlWimpImageBase::isOpaque ( ) const
inlineoverridevirtual

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 40 of file images_impeller.cc.

40{ return false; }

◆ isUIThreadSafe()

bool Skwasm::DlWimpImageBase::isUIThreadSafe ( ) const
inlineoverridevirtual

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 images_impeller.cc.

41{ return true; }

Member Data Documentation

◆ height_

◆ width_


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