10 #include "flutter/shell/platform/linux/testing/fl_test.h"
11 #include "flutter/shell/platform/linux/testing/linux_test.h"
12 #include "gtest/gtest.h"
22 fl_test_pixel_buffer_texture,
24 TEST_PIXEL_BUFFER_TEXTURE,
28 struct _FlTestPixelBufferTexture {
29 FlPixelBufferTexture parent_instance;
33 fl_test_pixel_buffer_texture,
34 fl_pixel_buffer_texture_get_type())
36 static gboolean fl_test_pixel_buffer_texture_copy_pixels(
37 FlPixelBufferTexture* texture,
42 EXPECT_TRUE(FL_IS_TEST_PIXEL_BUFFER_TEXTURE(texture));
45 static const uint8_t
buffer[] = {0x0a, 0x1a, 0x2a, 0x3a, 0x4a, 0x5a,
46 0x6a, 0x7a, 0x8a, 0x9a, 0xaa, 0xba,
47 0xca, 0xda, 0xea, 0xfa};
58 FlTestPixelBufferTextureClass* klass) {
59 FL_PIXEL_BUFFER_TEXTURE_CLASS(klass)->copy_pixels =
60 fl_test_pixel_buffer_texture_copy_pixels;
66 return FL_TEST_PIXEL_BUFFER_TEXTURE(
67 g_object_new(fl_test_pixel_buffer_texture_get_type(),
nullptr));
89 FlutterOpenGLTexture opengl_texture = {0};
93 EXPECT_EQ(
error,
nullptr);
~FlPixelBufferTextureTest()
FlPixelBufferTexture * texture
g_autoptr(FlEngine) engine
gboolean fl_pixel_buffer_texture_populate(FlPixelBufferTexture *texture, uint32_t width, uint32_t height, FlutterOpenGLTexture *opengl_texture, GError **error)
static void fl_test_pixel_buffer_texture_init(FlTestPixelBufferTexture *self)
static constexpr uint32_t kBufferWidth
const uint8_t uint32_t uint32_t * height
G_DEFINE_TYPE(FlTestPixelBufferTexture, fl_test_pixel_buffer_texture, fl_pixel_buffer_texture_get_type()) static gboolean fl_test_pixel_buffer_texture_copy_pixels(FlPixelBufferTexture *texture
const uint8_t uint32_t * width
static FlTestPixelBufferTexture * fl_test_pixel_buffer_texture_new()
static constexpr uint32_t kRealBufferHeight
static const uint8_t buffer[]
const uint8_t uint32_t uint32_t GError ** error
static constexpr uint32_t kBufferHeight
const uint8_t ** out_buffer
G_DECLARE_FINAL_TYPE(FlTestPixelBufferTexture, fl_test_pixel_buffer_texture, FL, TEST_PIXEL_BUFFER_TEXTURE, FlPixelBufferTexture) struct _FlTestPixelBufferTexture
A simple texture with fixed contents.
TEST_F(FlPixelBufferTextureTest, TextureID)
static constexpr uint32_t kRealBufferWidth
static void fl_test_pixel_buffer_texture_class_init(FlTestPixelBufferTextureClass *klass)
G_MODULE_EXPORT int64_t fl_texture_get_id(FlTexture *self)
void fl_texture_set_id(FlTexture *self, int64_t id)