Chris Bracken 3c27f944d9 macOS: ARC bridge casts for FlutterMetalTexture.user_data (flutter/engine#56518)
In `[FlutterSurface asFlutterMetalTexture]` we return a `FlutterMetalTexture` whose `user_data` field holds a `void*` reference to the associated `FlutterSurface`.

For conistency with other parts of the codebase, this now uses ARC bridge casts to perform the additional retain and release of the associated surface rather than CoreFoundation functions `CFBridgingRetain` and `CFBridigingRelease`. In FlutterEngine, for example:
67eb4ae000/shell/platform/darwin/macos/framework/Source/FlutterEngine.mm (L648-L664)

Also migrates the code to initialise and immediately return the struct using field designators, and reorders the assignments to be in the declaration order specified in embedder.h as required by the C++ spec.

No changes to tests since this introduces no semantic change.

Issue: https://github.com/flutter/flutter/issues/137801

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
2024-11-12 21:48:41 +00:00
..