Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update unit test for rendering texture
1.Make the texture red on the top half and blue on the botton half.
2.Add a new image file.
  • Loading branch information
xiaowei-guan committed Feb 24, 2026
commit 8da1bb32339fa8d4278df801ebcc1cddd27f7092
1 change: 1 addition & 0 deletions engine/src/flutter/shell/platform/embedder/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ test_fixtures("fixtures") {
"fixtures/vk_dpr_noxform.png",
"fixtures/vk_gradient.png",
"fixtures/gradient_metal.png",
"fixtures/external_texture_impeller.png",
"fixtures/external_texture_metal.png",
"fixtures/gradient_xform.png",
"fixtures/scene_without_custom_compositor.png",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4859,13 +4859,20 @@ TEST_F(EmbedderTest, RenderTextureWithImpellerOpenGL) {
[](void* user_data, int64_t texture_id, size_t width, size_t height,
FlutterOpenGLTexture* texture) -> bool {
std::vector<uint8_t> buffer(800 * 600 * 4);
for (int i = 0; i < 800 * 600; ++i) {
for (int i = 0; i < 800 * 300; ++i) {
buffer[i * 4 + 0] = 255; // Red channel
buffer[i * 4 + 1] = 0; // Green channel
buffer[i * 4 + 2] = 0; // Blue channel
buffer[i * 4 + 3] = 255; // Alpha channel (fully opaque)
}

for (int i = 800 * 300; i < 800 * 600; ++i) {
buffer[i * 4 + 0] = 0; // Red channel
buffer[i * 4 + 1] = 0; // Green channel
buffer[i * 4 + 2] = 255; // Blue channel
buffer[i * 4 + 3] = 255; // Alpha channel (fully opaque)
}

GLuint gl_texture;
glGenTextures(1, &gl_texture);
glBindTexture(GL_TEXTURE_2D, gl_texture);
Expand Down Expand Up @@ -4900,7 +4907,7 @@ TEST_F(EmbedderTest, RenderTextureWithImpellerOpenGL) {
kSuccess);
latch.Wait();
ASSERT_TRUE(
ImageMatchesFixture("external_texture_metal.png", rendered_scene));
ImageMatchesFixture("external_texture_impeller.png", rendered_scene));
}

TEST_F(EmbedderTest, ImpellerOpenGLImageSnapshot) {
Expand Down