-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initialize the texture destruction callback in the Metal embedder test harness #44973
Initialize the texture destruction callback in the Metal embedder test harness #44973
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
@@ -100,6 +100,7 @@ FlutterMetalTexture EmbedderTestContextMetal::GetNextDrawable( | |||
texture.texture_id = texture_info.texture_id; | |||
texture.texture = | |||
reinterpret_cast<FlutterMetalTextureHandle>(texture_info.texture); | |||
texture.destruction_callback = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this get initialized to nullptr in the struct itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...or can we not do that in a C struct
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no - the embedder API declarations are C compatible and do not offer a way to do this automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FlutterMetalTexture texture = {};
should zero out a C struct. In this case we declare the struct on line 98.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed this to use texture = {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Verified locally this makes the ASAN failures in #44813 happy
Its fine to land this but I prefer zero initializing all C structs entirely instead of manually zeroing members. This will make them more resilient in the future. |
14f30ed
to
c07eed4
Compare
…bedder test harness (flutter/engine#44973)
…bedder test harness (flutter/engine#44973)
…bedder test harness (flutter/engine#44973)
…bedder test harness (flutter/engine#44973)
…bedder test harness (flutter/engine#44973)
…bedder test harness (flutter/engine#44973)
…sions) (#133106) Manual roll requested by [email protected] flutter/engine@b190f90...7d56840 2023-08-23 [email protected] Revert "Roll Dart SDK from ab417bc74bb1 to c162b4979562 (1 revision)" (flutter/engine#44989) 2023-08-23 [email protected] Roll Fuchsia Mac SDK from G25oJMO5jbUi-UN4F... to DoQ8KUxSk-5EU6VQ1... (flutter/engine#44988) 2023-08-23 [email protected] Revert "Make `FontWeight` an enum, Remove unused text classes" (flutter/engine#44987) 2023-08-23 [email protected] Roll Dart SDK from ab417bc74bb1 to c162b4979562 (1 revision) (flutter/engine#44986) 2023-08-23 [email protected] Roll Fuchsia Linux SDK from kKI09su99b0AKs8b3... to VSvpNFoFjqXIQTcs6... (flutter/engine#44984) 2023-08-23 [email protected] Enable clang-tidy for pre-push (opt-out), exclude `performance-unnecessary-value-param` (flutter/engine#44936) 2023-08-22 [email protected] Restore old SurfaceTextureExternal drawing code (flutter/engine#44979) 2023-08-22 [email protected] Roll Skia from d0918de21c1a to aa208c8a2d60 (2 revisions) (flutter/engine#44981) 2023-08-22 [email protected] Initialize the texture destruction callback in the Metal embedder test harness (flutter/engine#44973) 2023-08-22 [email protected] Further filter/clear `<SkPaint>.setDither(true)`, this time in `DlSkPaintDispatchHelper` (flutter/engine#44912) 2023-08-22 [email protected] Roll Dart SDK from 3ebf0fedfceb to ab417bc74bb1 (1 revision) (flutter/engine#44977) 2023-08-22 [email protected] Roll Skia from bf6019be75ef to d0918de21c1a (3 revisions) (flutter/engine#44975) 2023-08-22 [email protected] Roll Skia from c675298ddeda to bf6019be75ef (3 revisions) (flutter/engine#44974) 2023-08-22 [email protected] Make `FontWeight` an enum, Remove unused text classes (flutter/engine#44960) 2023-08-22 [email protected] Roll Skia from 9f4b81aac175 to c675298ddeda (2 revisions) (flutter/engine#44971) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from kKI09su99b0A to VSvpNFoFjqXI fuchsia/sdk/core/mac-amd64 from G25oJMO5jbUi to DoQ8KUxSk-5E If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…bedder test harness (flutter/engine#44973)
Relands #42001. The previous attempt was reverted due to post-submit flakeness, some mysterious crashes. I didn't change anything this time, but now that PR #44973 is merged that fixes some racing issues, I wonder if the crashes of this change are resolved as well. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
Relands flutter#42001. The previous attempt was reverted due to post-submit flakeness, some mysterious crashes. I didn't change anything this time, but now that PR flutter#44973 is merged that fixes some racing issues, I wonder if the crashes of this change are resolved as well. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
No description provided.