Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
TextureSourceImageGenerator Class Reference
Inheritance diagram for TextureSourceImageGenerator:
GrExternalTextureGenerator GrTextureGenerator SkImageGenerator

Public Member Functions

 TextureSourceImageGenerator (SkImageInfo ii, SkwasmObject textureSource, Skwasm::Surface *surface)
 
std::unique_ptr< GrExternalTexturegenerateExternalTexture (GrRecordingContext *context, skgpu::Mipmapped mipmapped) override
 
- Public Member Functions inherited from GrExternalTextureGenerator
 GrExternalTextureGenerator (const SkImageInfo &info)
 
GrSurfaceProxyView onGenerateTexture (GrRecordingContext *, const SkImageInfo &, skgpu::Mipmapped, GrImageTexGenPolicy) override
 
virtual std::unique_ptr< GrExternalTexturegenerateExternalTexture (GrRecordingContext *, skgpu::Mipmapped)=0
 
- Public Member Functions inherited from GrTextureGenerator
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< 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)
 
virtual bool isTextureGenerator () const
 

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 onIsValid (GrRecordingContext *) const
 
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

Definition at line 83 of file image.cpp.

Constructor & Destructor Documentation

◆ TextureSourceImageGenerator()

TextureSourceImageGenerator::TextureSourceImageGenerator ( SkImageInfo  ii,
SkwasmObject  textureSource,
Skwasm::Surface surface 
)
inline

Definition at line 85 of file image.cpp.

89 _textureSourceWrapper(
90 surface->createTextureSourceWrapper(textureSource)) {}
GrExternalTextureGenerator(const SkImageInfo &info)
VkSurfaceKHR surface
Definition: main.cc:49

Member Function Documentation

◆ generateExternalTexture()

std::unique_ptr< GrExternalTexture > TextureSourceImageGenerator::generateExternalTexture ( GrRecordingContext context,
skgpu::Mipmapped  mipmapped 
)
inlineoverridevirtual

Implements GrExternalTextureGenerator.

Definition at line 92 of file image.cpp.

94 {
95 GrGLTextureInfo glInfo;
97 _textureSourceWrapper->getTextureSource(), fInfo.width(),
98 fInfo.height());
99 glInfo.fFormat = GL_RGBA8_OES;
100 glInfo.fTarget = GL_TEXTURE_2D;
101
102 auto backendTexture = GrBackendTextures::MakeGL(
104
105 // In order to bind the image source to the texture, makeTexture has changed
106 // which texture is "in focus" for the WebGL context.
108 return std::make_unique<ExternalWebGLTexture>(
109 backendTexture, glInfo.fID, emscripten_webgl_get_current_context());
110 }
static GrDirectContext * GrAsDirectContext(GrContext_Base *base)
@ kTextureBinding_GrGLBackendState
Definition: GrTypes.h:159
void resetContext(uint32_t state=kAll_GrBackendState)
const SkImageInfo fInfo
SK_API GrBackendTexture MakeGL(int width, int height, skgpu::Mipmapped, const GrGLTextureInfo &glInfo, std::string_view label={})
unsigned int skwasm_createGlTextureFromTextureSource(SkwasmObject textureSource, int width, int height)
GrGLuint fID
Definition: GrGLTypes.h:182
GrGLenum fFormat
Definition: GrGLTypes.h:183
GrGLenum fTarget
Definition: GrGLTypes.h:181
int width() const
Definition: SkImageInfo.h:365
int height() const
Definition: SkImageInfo.h:371

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