Skip to content
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

Merged

Conversation

jason-simmons
Copy link
Member

No description provided.

@jason-simmons jason-simmons requested a review from dnfield August 22, 2023 20:01
@flutter-dashboard
Copy link

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;
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

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 = {}

Copy link
Contributor

@dnfield dnfield left a 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

@chinmaygarde
Copy link
Member

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.

@jason-simmons jason-simmons force-pushed the mtl_test_texture_dtor_callback branch from 14f30ed to c07eed4 Compare August 22, 2023 20:46
@jason-simmons jason-simmons added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 22, 2023
@auto-submit auto-submit bot merged commit c323c85 into flutter:main Aug 22, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 22, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 22, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 23, 2023
zanderso pushed a commit to flutter/flutter that referenced this pull request Aug 23, 2023
…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
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 23, 2023
auto-submit bot pushed a commit that referenced this pull request Aug 24, 2023
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
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
gaaclarke pushed a commit to gaaclarke/engine that referenced this pull request Aug 30, 2023
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
@dkwingsmt dkwingsmt mentioned this pull request Dec 13, 2023
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants