18 if (gl_texture_ != 0) {
26 FlutterOpenGLTexture* opengl_texture) {
27 if (!CopyPixelBuffer(width, height)) {
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;
43 bool ExternalTexturePixelBuffer::CopyPixelBuffer(
size_t& width,
46 texture_callback_(width, height, user_data_);
47 if (!pixel_buffer || !pixel_buffer->
buffer) {
50 width = pixel_buffer->
width;
51 height = pixel_buffer->
height;
53 if (gl_texture_ == 0) {
57 gl_.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
58 gl_.
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
66 pixel_buffer->
height, 0, GL_RGBA, GL_UNSIGNED_BYTE,