5#include "flutter/shell/platform/windows/external_texture_pixelbuffer.h"
12 std::shared_ptr<egl::ProcTable>
gl)
18 if (gl_texture_ != 0) {
19 gl_->DeleteTextures(1, &gl_texture_);
32 opengl_texture->
target = GL_TEXTURE_2D;
33 opengl_texture->
name = gl_texture_;
34 opengl_texture->
format = GL_RGBA8_OES;
43bool ExternalTexturePixelBuffer::CopyPixelBuffer(
size_t&
width,
47 if (!pixel_buffer || !pixel_buffer->
buffer) {
53 if (gl_texture_ == 0) {
54 gl_->GenTextures(1, &gl_texture_);
56 gl_->BindTexture(GL_TEXTURE_2D, gl_texture_);
57 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
58 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
59 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
60 gl_->TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
63 gl_->BindTexture(GL_TEXTURE_2D, gl_texture_);
65 gl_->TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, pixel_buffer->
width,
66 pixel_buffer->
height, 0, GL_RGBA, GL_UNSIGNED_BYTE,
bool PopulateTexture(size_t width, size_t height, FlutterOpenGLTexture *opengl_texture) override
virtual ~ExternalTexturePixelBuffer()
ExternalTexturePixelBuffer(const FlutterDesktopPixelBufferTextureCallback texture_callback, void *user_data, std::shared_ptr< egl::ProcTable > gl)
const FlutterDesktopPixelBuffer *(* FlutterDesktopPixelBufferTextureCallback)(size_t width, size_t height, void *user_data)
void(* release_callback)(void *release_context)
uint32_t name
The name of the texture.
VoidCallback destruction_callback
void * user_data
User data to be returned on the invocation of the destruction callback.
size_t height
Height of the texture.
uint32_t format
The texture format (example GL_RGBA8).
FlutterDesktopPixelBufferTextureCallback texture_callback