Represents an image whose allocation is (usually) resident on device memory. More...
#include <dl_image.h>
Public Types | |
| enum class | OwningContext { kRaster , kIO } |
Public Member Functions | |
| virtual | ~DlImage () |
| virtual sk_sp< SkImage > | skia_image () const =0 |
| If this display list image is meant to be used by the Skia backend, an SkImage instance. Null otherwise. | |
| virtual std::shared_ptr< impeller::Texture > | impeller_texture () const =0 |
| If this display list image is meant to be used by the Impeller backend, an Impeller texture instance. Null otherwise. | |
| 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 | isTextureBacked () const =0 |
| 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 |
Static Public Member Functions | |
| static sk_sp< DlImage > | Make (const SkImage *image) |
| static sk_sp< DlImage > | Make (sk_sp< SkImage > image) |
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 32 of file dl_image.h.
|
strong |
|
virtualdefault |
|
protecteddefault |
|
inline |
|
inline |
Definition at line 127 of file dl_image.h.
References impeller_texture(), and skia_image().
Referenced by Equals().
|
inline |
Definition at line 140 of file dl_image.h.
References Equals().
|
virtual |
Reimplemented in flutter::DlDeferredImageGPUSkia.
Definition at line 35 of file dl_image.cc.
|
pure virtual |
Implemented in flutter::DlImageSkia, impeller::DlImageImpeller, flutter::DlDeferredImageGPUImpeller, flutter::DlDeferredImageGPUSkia, and flutter::DlImageGPU.
| DlIRect flutter::DlImage::GetBounds | ( | ) | const |
Definition at line 31 of file dl_image.cc.
References GetSize(), and impeller::TRect< T >::MakeSize().
|
pure virtual |
Implemented in flutter::DlImageSkia, impeller::DlImageImpeller, flutter::DlDeferredImageGPUImpeller, flutter::DlDeferredImageGPUSkia, and flutter::DlImageGPU.
Referenced by GetBounds(), height(), and width().
| int flutter::DlImage::height | ( | ) | const |
Definition at line 27 of file dl_image.cc.
References GetSize(), and impeller::TSize< T >::height.
|
pure virtual |
If this display list image is meant to be used by the Impeller backend, an Impeller texture instance. Null otherwise.
Implemented in flutter::DlImageSkia, impeller::DlImageImpeller, flutter::DlDeferredImageGPUImpeller, flutter::DlDeferredImageGPUSkia, and flutter::DlImageGPU.
Referenced by Equals().
|
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::DlImageImpeller, flutter::DlDeferredImageGPUImpeller, flutter::DlDeferredImageGPUSkia, and flutter::DlImageGPU.
|
pure virtual |
|
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::DlImageImpeller, flutter::DlDeferredImageGPUImpeller, flutter::DlDeferredImageGPUSkia, and flutter::DlImageGPU.
|
static |
Definition at line 11 of file dl_image.cc.
Referenced by flutter::testing::BM_DrawImage(), flutter::testing::BM_DrawImageNine(), flutter::testing::BM_DrawImageRect(), flutter::testing::CreateAllRenderingOps(), Make(), flutter::testing::MakeTestImage(), flutter::testing::MakeTestImage(), flutter::testing::MockTexture::MakeTestTexture(), flutter::RasterCache::Rasterize(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::DisplayListNopTest::test_attributes_image().
|
static |
Definition at line 15 of file dl_image.cc.
References image.
|
inlinevirtual |
Reimplemented in impeller::DlImageImpeller, flutter::DlDeferredImageGPUImpeller, and flutter::DlDeferredImageGPUSkia.
Definition at line 116 of file dl_image.h.
References kIO.
|
pure virtual |
If this display list image is meant to be used by the Skia backend, an SkImage instance. Null otherwise.
Implemented in flutter::DlImageSkia, impeller::DlImageImpeller, flutter::DlDeferredImageGPUImpeller, flutter::DlDeferredImageGPUSkia, and flutter::DlImageGPU.
Referenced by Equals().
| int flutter::DlImage::width | ( | ) | const |
Definition at line 23 of file dl_image.cc.
References GetSize(), and impeller::TSize< T >::width.