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

#include <external_texture_d3d.h>

Inheritance diagram for flutter::ExternalTextureD3d:
flutter::ExternalTexture

Public Member Functions

 ExternalTextureD3d (FlutterDesktopGpuSurfaceType type, const FlutterDesktopGpuSurfaceTextureCallback texture_callback, void *user_data, const egl::Manager *egl_manager, std::shared_ptr< egl::ProcTable > gl)
 
virtual ~ExternalTextureD3d ()
 
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 19 of file external_texture_d3d.h.

Constructor & Destructor Documentation

◆ ExternalTextureD3d()

flutter::ExternalTextureD3d::ExternalTextureD3d ( FlutterDesktopGpuSurfaceType  type,
const FlutterDesktopGpuSurfaceTextureCallback  texture_callback,
void *  user_data,
const egl::Manager egl_manager,
std::shared_ptr< egl::ProcTable gl 
)

Definition at line 12 of file external_texture_d3d.cc.

18 : type_(type),
19 texture_callback_(texture_callback),
20 user_data_(user_data),
21 egl_manager_(egl_manager),
22 gl_(std::move(gl)) {}
GLenum type
gl
Definition: malisc.py:41
void * user_data
FlutterDesktopPixelBufferTextureCallback texture_callback

◆ ~ExternalTextureD3d()

flutter::ExternalTextureD3d::~ExternalTextureD3d ( )
virtual

Definition at line 24 of file external_texture_d3d.cc.

24 {
25 ReleaseImage();
26
27 if (gl_texture_ != 0) {
28 gl_->DeleteTextures(1, &gl_texture_);
29 }
30}

Member Function Documentation

◆ PopulateTexture()

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

Implements flutter::ExternalTexture.

Definition at line 32 of file external_texture_d3d.cc.

34 {
35 const FlutterDesktopGpuSurfaceDescriptor* descriptor =
36 texture_callback_(width, height, user_data_);
37
38 if (!CreateOrUpdateTexture(descriptor)) {
39 return false;
40 }
41
42 // Populate the texture object used by the engine.
43 opengl_texture->target = GL_TEXTURE_2D;
44 opengl_texture->name = gl_texture_;
45 opengl_texture->format = GL_RGBA8_OES;
46 opengl_texture->destruction_callback = nullptr;
47 opengl_texture->user_data = nullptr;
48 opengl_texture->width = SAFE_ACCESS(descriptor, visible_width, 0);
49 opengl_texture->height = SAFE_ACCESS(descriptor, visible_height, 0);
50
51 return true;
52}
#define SAFE_ACCESS(pointer, member, default_value)
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: