Chris Bracken 0fab2ea52d [embedder] Ensure destruction called on present (flutter/engine#38078)
This is a followup to flutter/engine#38038.

In that patch, a destruction callback for textures created via the
FlutterRendererConfig callbacks (as opposed to by the FlutterCompositor
callbacks) was added and passed through to the texture info attached to
the SurfaceFrame generated in
GPUSurfaceMetalSkia::AcquireFrameFromMTLTexture (called via
GPUSurfaceMetalSkia::GetMTLTexture, which invokes the
get_next_drawable_callback), however, in order for the destruction
callback to make it to the presented Skia texture, it needs to be passed
through to the present callback here:
960af0a350/shell/gpu/gpu_surface_metal_skia.mm (LL233)

which is invoked by the submit callback passed to Skia:
960af0a350/shell/gpu/gpu_surface_metal_skia.mm (LL239)

The present callback is implemented in EmbedderSurface::PresentTexture,
which invokes the present callback registered in
FlutterMetalRendererConfig.present_drawable_callback. This patch ensures
that the destruction callback is passed through to Skia's present
callback so destruction occurs in the right place.

Issue: https://github.com/flutter/flutter/issues/116381
2022-12-07 20:40:22 +00:00
Languages
Dart 75%
C++ 16.5%
Objective-C++ 2.9%
Java 2.8%
Objective-C 0.7%
Other 1.9%