Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Fix a flake in EmbedderTest.CompositorRenderTargetsNotRecycledWhenAvoidsCacheSet #39596

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
20 changes: 20 additions & 0 deletions shell/platform/embedder/fixtures/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -989,6 +989,26 @@ void compositor_can_post_only_platform_views() {

@pragma('vm:entry-point')
void render_targets_are_recycled() {
int frame_count = 0;
PlatformDispatcher.instance.onBeginFrame = (Duration duration) {
SceneBuilder builder = SceneBuilder();
for (int i = 0; i < 10; i++) {
builder.addPicture(Offset(0.0, 0.0), CreateGradientBox(Size(30.0, 20.0)));
builder.addPlatformView(42 + i, width: 30.0, height: 20.0);
}
PlatformDispatcher.instance.views.first.render(builder.build());
frame_count++;
if (frame_count == 8) {
signalNativeTest();
} else {
PlatformDispatcher.instance.scheduleFrame();
}
};
PlatformDispatcher.instance.scheduleFrame();
}

@pragma('vm:entry-point')
void render_targets_are_in_stable_order() {
int frame_count = 0;
PlatformDispatcher.instance.onBeginFrame = (Duration duration) {
SceneBuilder builder = SceneBuilder();
Expand Down
4 changes: 2 additions & 2 deletions shell/platform/embedder/tests/embedder_gl_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2977,7 +2977,7 @@ TEST_F(EmbedderTest, CompositorRenderTargetsAreInStableOrder) {
EmbedderConfigBuilder builder(context);
builder.SetOpenGLRendererConfig(SkISize::Make(300, 200));
builder.SetCompositor();
builder.SetDartEntrypoint("render_targets_are_recycled");
builder.SetDartEntrypoint("render_targets_are_in_stable_order");
builder.SetRenderTargetType(
EmbedderTestBackingStoreProducer::RenderTargetType::kOpenGLTexture);

Expand Down Expand Up @@ -4018,7 +4018,7 @@ TEST_F(EmbedderTest, ExternalTextureGLRefreshedTooOften) {
TestGLSurface surface(SkISize::Make(100, 100));
auto context = surface.GetGrContext();

typedef void (*glGenTexturesProc)(uint32_t n, uint32_t * textures);
typedef void (*glGenTexturesProc)(uint32_t n, uint32_t* textures);
glGenTexturesProc glGenTextures;

glGenTextures = reinterpret_cast<glGenTexturesProc>(
Expand Down