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

Commit

Permalink
Fix a flake in EmbedderTest.CompositorRenderTargetsNotRecycledWhenAvo…
Browse files Browse the repository at this point in the history
…idsCacheSet (#39596)

The test assumes that the fixture app has scheduled a specific number
of frames.  The fixture should stop scheduling after that point.

See flutter/flutter#106589
  • Loading branch information
jason-simmons authored Feb 14, 2023
1 parent b1f76fb commit a85220d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
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

0 comments on commit a85220d

Please sign in to comment.