21 fl_pixel_buffer_texture,
23 G_IMPLEMENT_INTERFACE(fl_texture_get_type(),
25 G_ADD_PRIVATE(FlPixelBufferTexture))
28 static void fl_pixel_buffer_texture_set_id(FlTexture* texture, int64_t
id) {
29 FlPixelBufferTexture*
self = FL_PIXEL_BUFFER_TEXTURE(texture);
32 fl_pixel_buffer_texture_get_instance_private(
self));
38 FlPixelBufferTexture*
self = FL_PIXEL_BUFFER_TEXTURE(texture);
41 fl_pixel_buffer_texture_get_instance_private(
self));
46 iface->set_id = fl_pixel_buffer_texture_set_id;
51 FlPixelBufferTexture*
self = FL_PIXEL_BUFFER_TEXTURE(
object);
54 fl_pixel_buffer_texture_get_instance_private(
self));
61 G_OBJECT_CLASS(fl_pixel_buffer_texture_parent_class)->dispose(
object);
65 GLenum err = glGetError();
67 g_warning(
"glGetError %x (%s:%d)\n", err, __FILE__, line);
74 FlutterOpenGLTexture* opengl_texture,
76 FlPixelBufferTexture*
self = FL_PIXEL_BUFFER_TEXTURE(texture);
79 fl_pixel_buffer_texture_get_instance_private(
self));
81 const uint8_t*
buffer =
nullptr;
82 if (!FL_PIXEL_BUFFER_TEXTURE_GET_CLASS(
self)->copy_pixels(
92 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
94 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
96 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
98 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
104 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8,
width,
height, 0, GL_RGBA,
105 GL_UNSIGNED_BYTE,
buffer);
108 opengl_texture->target = GL_TEXTURE_2D;
110 opengl_texture->format = GL_RGBA8;
111 opengl_texture->destruction_callback =
nullptr;
112 opengl_texture->user_data =
nullptr;
113 opengl_texture->width =
width;
114 opengl_texture->height =
height;
120 FlPixelBufferTextureClass* klass) {