5#include "flutter/shell/platform/linux/public/flutter_linux/fl_pixel_buffer_texture.h"
10#include "flutter/shell/platform/linux/fl_pixel_buffer_texture_private.h"
21 fl_pixel_buffer_texture,
23 G_IMPLEMENT_INTERFACE(fl_texture_get_type(),
25 G_ADD_PRIVATE(FlPixelBufferTexture))
28static 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);
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;
120 FlPixelBufferTextureClass* klass) {
static void fl_pixel_buffer_texture_class_init(FlPixelBufferTextureClass *klass)
static void check_gl_error(int line)
static void fl_pixel_buffer_texture_iface_init(FlTextureInterface *iface)
FlPixelBufferTexturePrivate * priv
static void fl_pixel_buffer_texture_init(FlPixelBufferTexture *self)
gboolean fl_pixel_buffer_texture_populate(FlPixelBufferTexture *texture, uint32_t width, uint32_t height, FlutterOpenGLTexture *opengl_texture, GError **error)
G_DEFINE_TYPE_WITH_CODE(FlPixelBufferTexture, fl_pixel_buffer_texture, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(fl_texture_get_type(), fl_pixel_buffer_texture_iface_init);G_ADD_PRIVATE(FlPixelBufferTexture)) static void fl_pixel_buffer_texture_set_id(FlTexture *texture
static int64_t fl_pixel_buffer_texture_get_id(FlTexture *texture)
static void fl_pixel_buffer_texture_dispose(GObject *object)
const uint8_t uint32_t uint32_t GError ** error
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
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).