Flutter Windows Embedder
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
 

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)) {}

◆ ~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 }

The documentation for this class was generated from the following files:
user_data
void * user_data
Definition: flutter_windows_view_unittests.cc:53
texture_callback
FlutterDesktopPixelBufferTextureCallback texture_callback
Definition: texture_registrar_unittests.cc:26