Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::ExternalTexturePixelBuffer Class Reference

#include <external_texture_pixelbuffer.h>

Inheritance diagram for flutter::ExternalTexturePixelBuffer:
flutter::ExternalTexture

Public Member Functions

 ExternalTexturePixelBuffer (const FlutterDesktopPixelBufferTextureCallback texture_callback, void *user_data, std::shared_ptr< egl::ProcTable > gl)
 
virtual ~ExternalTexturePixelBuffer ()
 
bool PopulateTexture (size_t width, size_t height, FlutterOpenGLTexture *opengl_texture) override
 
- Public Member Functions inherited from flutter::ExternalTexture
virtual ~ExternalTexture ()=default
 
int64_t texture_id () const
 
virtual bool PopulateTexture (size_t width, size_t height, FlutterOpenGLTexture *opengl_texture)=0
 

Detailed Description

Definition at line 16 of file external_texture_pixelbuffer.h.

Constructor & Destructor Documentation

◆ ExternalTexturePixelBuffer()

flutter::ExternalTexturePixelBuffer::ExternalTexturePixelBuffer ( const FlutterDesktopPixelBufferTextureCallback  texture_callback,
void *  user_data,
std::shared_ptr< egl::ProcTable gl 
)

Definition at line 9 of file external_texture_pixelbuffer.cc.

13 : texture_callback_(texture_callback),
14 user_data_(user_data),
15 gl_(std::move(gl)) {}
gl
Definition: malisc.py:41
void * user_data
FlutterDesktopPixelBufferTextureCallback texture_callback

◆ ~ExternalTexturePixelBuffer()

flutter::ExternalTexturePixelBuffer::~ExternalTexturePixelBuffer ( )
virtual

Definition at line 17 of file external_texture_pixelbuffer.cc.

17 {
18 if (gl_texture_ != 0) {
19 gl_->DeleteTextures(1, &gl_texture_);
20 }
21}

Member Function Documentation

◆ PopulateTexture()

bool flutter::ExternalTexturePixelBuffer::PopulateTexture ( size_t  width,
size_t  height,
FlutterOpenGLTexture opengl_texture 
)
overridevirtual

Implements flutter::ExternalTexture.

Definition at line 23 of file external_texture_pixelbuffer.cc.

26 {
27 if (!CopyPixelBuffer(width, height)) {
28 return false;
29 }
30
31 // Populate the texture object used by the engine.
32 opengl_texture->target = GL_TEXTURE_2D;
33 opengl_texture->name = gl_texture_;
34 opengl_texture->format = GL_RGBA8_OES;
35 opengl_texture->destruction_callback = nullptr;
36 opengl_texture->user_data = nullptr;
37 opengl_texture->width = width;
38 opengl_texture->height = height;
39
40 return true;
41}
int32_t height
int32_t width
uint32_t name
The name of the texture.
Definition: embedder.h:371
VoidCallback destruction_callback
Definition: embedder.h:378
void * user_data
User data to be returned on the invocation of the destruction callback.
Definition: embedder.h:375
size_t height
Height of the texture.
Definition: embedder.h:386
uint32_t format
The texture format (example GL_RGBA8).
Definition: embedder.h:373

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