Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
GrAHardwareBufferImageGenerator Class Reference

#include <GrAHardwareBufferImageGenerator.h>

Inheritance diagram for GrAHardwareBufferImageGenerator:
GrTextureGenerator SkImageGenerator

Public Member Functions

 ~GrAHardwareBufferImageGenerator () override
 
- Public Member Functions inherited from GrTextureGenerator
bool isTextureGenerator () const final
 
GrSurfaceProxyView generateTexture (GrRecordingContext *, const SkImageInfo &info, skgpu::Mipmapped mipmapped, GrImageTexGenPolicy)
 
- Public Member Functions inherited from SkImageGenerator
virtual ~SkImageGenerator ()
 
uint32_t uniqueID () const
 
sk_sp< SkDatarefEncodedData ()
 
const SkImageInfogetInfo () 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)
 

Static Public Member Functions

static std::unique_ptr< SkImageGeneratorMake (AHardwareBuffer *, SkAlphaType, sk_sp< SkColorSpace >, GrSurfaceOrigin)
 
static void DeleteGLTexture (void *ctx)
 

Private Member Functions

bool onIsValid (GrRecordingContext *) const override
 
GrSurfaceProxyView onGenerateTexture (GrRecordingContext *, const SkImageInfo &, skgpu::Mipmapped, GrImageTexGenPolicy) override
 
GrSurfaceOrigin origin () const override
 

Additional Inherited Members

- Protected Member Functions inherited from GrTextureGenerator
 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< SkDataonRefEncodedData ()
 
virtual bool onGetPixels (const SkImageInfo &, void *, size_t, const Options &)
 
virtual bool onIsProtected () const
 
virtual bool onQueryYUVAInfo (const SkYUVAPixmapInfo::SupportedDataTypes &, SkYUVAPixmapInfo *) const
 
virtual bool onGetYUVAPlanes (const SkYUVAPixmaps &)
 
- Protected Attributes inherited from SkImageGenerator
const SkImageInfo fInfo
 
- Static Protected Attributes inherited from SkImageGenerator
static constexpr int kNeedNewImageUniqueID = 0
 

Detailed Description

GrAHardwareBufferImageGenerator allows to create an SkImage attached to an existing android native hardware buffer. A hardware buffer has to be created with AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE usage, because it is bound to an external texture using an EGLImage. The image generator will keep a reference to the hardware buffer for its lifetime. A hardware buffer can be shared between processes and same buffer can be used in multiple GPU contexts. To implement certain features like tiling, Skia may copy the texture to avoid OpenGL API limitations.

Definition at line 31 of file GrAHardwareBufferImageGenerator.h.

Constructor & Destructor Documentation

◆ ~GrAHardwareBufferImageGenerator()

GrAHardwareBufferImageGenerator::~GrAHardwareBufferImageGenerator ( )
override

Member Function Documentation

◆ DeleteGLTexture()

static void GrAHardwareBufferImageGenerator::DeleteGLTexture ( void *  ctx)
static

◆ Make()

static std::unique_ptr< SkImageGenerator > GrAHardwareBufferImageGenerator::Make ( AHardwareBuffer ,
SkAlphaType  ,
sk_sp< SkColorSpace ,
GrSurfaceOrigin   
)
static

◆ onGenerateTexture()

GrSurfaceProxyView GrAHardwareBufferImageGenerator::onGenerateTexture ( GrRecordingContext ,
const SkImageInfo ,
skgpu::Mipmapped  ,
GrImageTexGenPolicy   
)
overrideprivatevirtual

Implements GrTextureGenerator.

◆ onIsValid()

bool GrAHardwareBufferImageGenerator::onIsValid ( GrRecordingContext ) const
overrideprivatevirtual

Reimplemented from SkImageGenerator.

◆ origin()

GrSurfaceOrigin GrAHardwareBufferImageGenerator::origin ( ) const
inlineoverrideprivatevirtual

Reimplemented from GrTextureGenerator.

Definition at line 52 of file GrAHardwareBufferImageGenerator.h.

52{ return fSurfaceOrigin; }

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