Represents an image whose allocation is (usually) resident on device memory. More...
#include <dl_image.h>
Public Types | |
| enum class | OwningContext { kRaster , kIO } |
| enum class | Type { kSkia , kImpeller } |
| The backend type of this image. More... | |
Public Member Functions | |
| virtual | ~DlImage () |
| virtual Type | GetImageType () const =0 |
| Returns the backend type of this image. | |
| virtual const DlImageSkia * | asSkiaImage () const |
| Safe downcast to DlImageSkia. | |
| virtual const impeller::DlImageImpeller * | asImpellerImage () const |
| Safe downcast to DlImageImpeller. | |
| virtual bool | isTextureBacked () const =0 |
| Returns true if the image is backed by a GPU texture. | |
| virtual DlColorSpace | GetColorSpace () const =0 |
| Gets the color space of the image. | |
| virtual bool | isOpaque () const =0 |
| 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. | |
| virtual bool | isUIThreadSafe () const =0 |
| 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. | |
| virtual DlISize | GetSize () const =0 |
| virtual size_t | GetApproximateByteSize () const =0 |
| 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 Member Functions | |
| DlImage () | |
Represents an image whose allocation is (usually) resident on device memory.
Since it is usually impossible or expensive to transmute images for one rendering backend to another, these objects are backend specific.
Definition at line 34 of file dl_image.h.
|
strong |
|
strong |
The backend type of this image.
| Enumerator | |
|---|---|
| kSkia | |
| kImpeller | |
Definition at line 44 of file dl_image.h.
|
virtualdefault |
|
protecteddefault |
|
inlinevirtual |
Safe downcast to DlImageImpeller.
Reimplemented in impeller::DlImageImpeller.
Definition at line 65 of file dl_image.h.
|
inlinevirtual |
Safe downcast to DlImageSkia.
Reimplemented in flutter::DlImageSkia.
Definition at line 58 of file dl_image.h.
Referenced by Equals().
|
inline |
| bool flutter::DlImage::Equals | ( | const DlImage * | other | ) | const |
Definition at line 31 of file dl_image.cc.
References asSkiaImage(), and flutter::DlImageSkia::skia_image().
Referenced by Equals().
|
inline |
Definition at line 147 of file dl_image.h.
References Equals().
|
virtual |
Reimplemented in flutter::DlDeferredImageGPUSkia, and flutter::PixelDeferredImageGPUImpeller.
Definition at line 27 of file dl_image.cc.
|
pure virtual |
Implemented in flutter::DlImageSkia, impeller::DlImageImpellerTexture, flutter::DlDeferredImageGPUImpeller, flutter::DlDeferredImageGPUSkia, flutter::DlImageGPU, flutter::PixelDeferredImageGPUImpeller, and Skwasm::DlWimpImageBase.
| DlIRect flutter::DlImage::GetBounds | ( | ) | const |
Definition at line 23 of file dl_image.cc.
References GetSize(), and impeller::TRect< T >::MakeSize().
|
pure virtual |
Gets the color space of the image.
Implemented in flutter::DlImageSkia, impeller::DlImageImpellerTexture, flutter::DlDeferredImageGPUImpeller, flutter::PixelDeferredImageGPUImpeller, and Skwasm::DlWimpImageBase.
|
pure virtual |
Returns the backend type of this image.
Implemented in flutter::DlImageSkia, and impeller::DlImageImpeller.
|
pure virtual |
Implemented in flutter::DlImageSkia, impeller::DlImageImpellerTexture, flutter::DlDeferredImageGPUImpeller, flutter::DlDeferredImageGPUSkia, flutter::DlImageGPU, flutter::PixelDeferredImageGPUImpeller, and Skwasm::DlWimpImageBase.
Referenced by GetBounds(), height(), and width().
| int flutter::DlImage::height | ( | ) | const |
Definition at line 19 of file dl_image.cc.
References GetSize(), and impeller::TSize< T >::height.
|
pure virtual |
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.
Implemented in flutter::DlImageSkia, impeller::DlImageImpellerTexture, flutter::DlDeferredImageGPUImpeller, flutter::DlDeferredImageGPUSkia, flutter::DlImageGPU, flutter::PixelDeferredImageGPUImpeller, and Skwasm::DlWimpImageBase.
|
pure virtual |
Returns true if the image is backed by a GPU texture.
Implemented in flutter::DlImageSkia, and impeller::DlImageImpeller.
|
pure virtual |
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.
Implemented in flutter::DlImageSkia, impeller::DlImageImpellerTexture, flutter::DlDeferredImageGPUImpeller, flutter::DlDeferredImageGPUSkia, flutter::DlImageGPU, flutter::PixelDeferredImageGPUImpeller, and Skwasm::DlWimpImageBase.
|
inlinevirtual |
Reimplemented in impeller::DlImageImpellerTexture, flutter::DlDeferredImageGPUImpeller, and flutter::DlDeferredImageGPUSkia.
Definition at line 136 of file dl_image.h.
References kIO.
Referenced by impeller::DlImageImpeller::Make().
| int flutter::DlImage::width | ( | ) | const |
Definition at line 15 of file dl_image.cc.
References GetSize(), and impeller::TSize< T >::width.