Flutter Engine
The Flutter Engine
|
#include <GrTextureGenerator.h>
Public Member Functions | |
bool | isTextureGenerator () const final |
GrSurfaceProxyView | generateTexture (GrRecordingContext *, const SkImageInfo &info, skgpu::Mipmapped mipmapped, GrImageTexGenPolicy) |
virtual GrSurfaceProxyView | onGenerateTexture (GrRecordingContext *, const SkImageInfo &, skgpu::Mipmapped, GrImageTexGenPolicy)=0 |
virtual GrSurfaceOrigin | origin () const |
Public Member Functions inherited from SkImageGenerator | |
virtual | ~SkImageGenerator () |
uint32_t | uniqueID () const |
sk_sp< SkData > | refEncodedData () |
const SkImageInfo & | getInfo () const |
bool | isValid (GrRecordingContext *context) const |
bool | isProtected () const |
bool | getPixels (const SkImageInfo &info, void *pixels, size_t rowBytes) |
bool | getPixels (const SkPixmap &pm) |
bool | queryYUVAInfo (const SkYUVAPixmapInfo::SupportedDataTypes &supportedDataTypes, SkYUVAPixmapInfo *yuvaPixmapInfo) const |
bool | getYUVAPlanes (const SkYUVAPixmaps &yuvaPixmaps) |
virtual bool | isTextureGenerator () const |
Protected Member Functions | |
GrTextureGenerator (const SkImageInfo &info, uint32_t uniqueId=kNeedNewImageUniqueID) | |
Protected Member Functions inherited from SkImageGenerator | |
SkImageGenerator (const SkImageInfo &info, uint32_t uniqueId=kNeedNewImageUniqueID) | |
virtual sk_sp< SkData > | onRefEncodedData () |
virtual bool | onGetPixels (const SkImageInfo &, void *, size_t, const Options &) |
virtual bool | onIsValid (GrRecordingContext *) const |
virtual bool | onIsProtected () const |
virtual bool | onQueryYUVAInfo (const SkYUVAPixmapInfo::SupportedDataTypes &, SkYUVAPixmapInfo *) const |
virtual bool | onGetYUVAPlanes (const SkYUVAPixmaps &) |
Additional Inherited Members | |
Protected Attributes inherited from SkImageGenerator | |
const SkImageInfo | fInfo |
Static Protected Attributes inherited from SkImageGenerator | |
static constexpr int | kNeedNewImageUniqueID = 0 |
Definition at line 23 of file GrTextureGenerator.h.
|
protected |
Definition at line 42 of file GrTextureGenerator.cpp.
GrSurfaceProxyView GrTextureGenerator::generateTexture | ( | GrRecordingContext * | ctx, |
const SkImageInfo & | info, | ||
skgpu::Mipmapped | mipmapped, | ||
GrImageTexGenPolicy | texGenPolicy | ||
) |
If the generator can natively/efficiently return its pixels as a GPU image (backed by a texture) this will return that image. If not, this will return NULL.
Regarding the GrRecordingContext parameter:
It must be non-NULL. The generator should only succeed if:
If the mipmapped parameter is kYes, the generator should try to create a TextureProxy that at least has the mip levels allocated and the base layer filled in. If this is not possible, the generator is allowed to return a non mipped proxy, but this will have some additional overhead in later allocating mips and copying of the base layer.
GrImageTexGenPolicy determines whether or not a new texture must be created (and its budget status) or whether this may (but is not required to) return a pre-existing texture that is retained by the generator (kDraw).
Definition at line 45 of file GrTextureGenerator.cpp.
|
inlinefinalvirtual |
Reimplemented from SkImageGenerator.
Definition at line 25 of file GrTextureGenerator.h.
|
pure virtual |
Implemented in GrBackendTextureImageGenerator, GrExternalTextureGenerator, and TextureGenerator.
|
inlinevirtual |
Definition at line 60 of file GrTextureGenerator.h.