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

Commit b4c4dfc

Browse files
[Impeller] Start and end a frame in the RenderTargetCache for each rendering of an entity in the playgrounds (#49576)
This fixes the memory leak in the GaussianBlurFilter playground described in #48472
1 parent 00ff332 commit b4c4dfc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

impeller/entity/entity_playground.cc

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ bool EntityPlayground::OpenPlaygroundHere(Entity entity) {
5050
return false;
5151
}
5252
SinglePassCallback callback = [&](RenderPass& pass) -> bool {
53-
return entity.Render(*content_context, pass);
53+
content_context->GetRenderTargetCache()->Start();
54+
bool result = entity.Render(*content_context, pass);
55+
content_context->GetRenderTargetCache()->End();
56+
return result;
5457
};
5558
return Playground::OpenPlaygroundHere(callback);
5659
}
@@ -70,7 +73,10 @@ bool EntityPlayground::OpenPlaygroundHere(EntityPlaygroundCallback callback) {
7073
wireframe = !wireframe;
7174
content_context.SetWireframe(wireframe);
7275
}
73-
return callback(content_context, pass);
76+
content_context.GetRenderTargetCache()->Start();
77+
bool result = callback(content_context, pass);
78+
content_context.GetRenderTargetCache()->End();
79+
return result;
7480
};
7581
return Playground::OpenPlaygroundHere(pass_callback);
7682
}

0 commit comments

Comments
 (0)