[Impeller] Fix memory leak I introduced by fixing memory leak. (flutter/engine#55087)

If we don't reset host buffer then leak
This commit is contained in:
Jonah Williams
2024-09-10 15:16:55 -07:00
committed by GitHub
parent 9ac366a022
commit 849f1d7170
3 changed files with 4 additions and 4 deletions

View File

@@ -141,7 +141,7 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceGLImpeller::AcquireFrame(
auto picture = impeller_dispatcher.EndRecordingAsPicture();
return aiks_context->Render(picture, render_target,
/*reset_host_buffer=*/false);
/*reset_host_buffer=*/true);
#endif // EXPERIMENTAL_CANVAS
};

View File

@@ -320,9 +320,9 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceMetalImpeller::AcquireFrameFromMTLTextur
display_list->Dispatch(impeller_dispatcher, sk_cull_rect);
auto picture = impeller_dispatcher.EndRecordingAsPicture();
const bool reset_host_buffer = surface_frame.submit_info().frame_boundary;
const impeller::RenderTarget& render_target = surface->GetTargetRenderPassDescriptor();
bool render_result = aiks_context->Render(picture, render_target, reset_host_buffer);
bool render_result =
aiks_context->Render(picture, render_target, /*reset_host_buffer=*/true);
#endif
if (!render_result) {
FML_LOG(ERROR) << "Failed to render Impeller frame";

View File

@@ -103,7 +103,7 @@ std::unique_ptr<SurfaceFrame> GPUSurfaceVulkanImpeller::AcquireFrame(
SkIRect::MakeWH(cull_rect.width, cull_rect.height));
auto picture = impeller_dispatcher.EndRecordingAsPicture();
return aiks_context->Render(picture, render_target,
/*reset_host_buffer=*/false);
/*reset_host_buffer=*/true);
#endif
};