This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Commit a57a4a7
authored
macOS: ARC bridge casts for FlutterMetalTexture.user_data (#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:
https://github.com/flutter/engine/blob/a672f971c65930f620c7542be58e15669372e16f/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: flutter/flutter#137801
[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style1 parent ff9931a commit a57a4a7
1 file changed
Lines changed: 14 additions & 14 deletions
Lines changed: 14 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | 55 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
0 commit comments