Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[skwasm] Reify the SkPicture pointer as the right type. #51991

Merged
merged 1 commit into from
Apr 9, 2024

Conversation

eyebrowsoffire
Copy link
Contributor

When recreating this unique_ptr, we need to ensure it matches the type in Surface::renderPictures which is released. See here:

  std::unique_ptr<sk_sp<SkPicture>[]> picturePointers =
      std::make_unique<sk_sp<SkPicture>[]>(count);
  for (int i = 0; i < count; i++) {
    picturePointers[i] = sk_ref_sp(pictures[i]);
  }
  // Releasing picturePointers here and will recreate the unique_ptr on the
  // other thread See surface_renderPicturesOnWorker
  skwasm_dispatchRenderPictures(_thread, this, picturePointers.release(), count,
                                callbackId);

@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 "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use 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.

@github-actions github-actions bot added the platform-web Code specifically for the web engine label Apr 9, 2024
@eyebrowsoffire
Copy link
Contributor Author

This is a subtle memory issue that may have been exposed if we had been running our unit tests against a debug build of skwasm. I have filed flutter/flutter#146516 as a follow-on to get better coverage here.

@eyebrowsoffire eyebrowsoffire requested a review from yjbanov April 9, 2024 17:20
@eyebrowsoffire eyebrowsoffire added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 9, 2024
@auto-submit auto-submit bot merged commit efd85b7 into flutter:main Apr 9, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 9, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 9, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 9, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 9, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Apr 9, 2024
…146524)

flutter/engine@5a824e2...5dca50d

2024-04-09 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Delete engine v1 android embedding (#51229)" (flutter/engine#51996)
2024-04-09 34871572+gmackall@users.noreply.github.com Delete engine v1 android embedding (flutter/engine#51229)
2024-04-09 flar@google.com better output from engine layer unit test failures (flutter/engine#51975)
2024-04-09 zanderso@users.noreply.github.com Revert "Roll Dart SDK from 78174b41ab0f to 7a5e410f982e (1 revision) (#51980)" (flutter/engine#51990)
2024-04-09 jacksongardner@google.com [skwasm] Reify the SkPicture pointer as the right type. (flutter/engine#51991)
2024-04-09 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Dart SDK from 7a5e410f982e to db99af14c4bc (1 revision) (#51986)" (flutter/engine#51989)
2024-04-09 jason-simmons@users.noreply.github.com Move the Dart SDK to //flutter/third_party/dart (flutter/engine#51917)
2024-04-09 matej.knopp@gmail.com [macOS] Implement hit testing and handle platform view cursor changes (flutter/engine#43101)
2024-04-09 skia-flutter-autoroll@skia.org Roll Dart SDK from 7a5e410f982e to db99af14c4bc (1 revision) (flutter/engine#51986)
2024-04-09 skia-flutter-autoroll@skia.org Roll Dart SDK from 78174b41ab0f to 7a5e410f982e (1 revision) (flutter/engine#51980)

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 chinmaygarde@google.com,rmistry@google.com,zra@google.com 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
gilnobrega pushed a commit to gilnobrega/flutter that referenced this pull request Apr 22, 2024
…lutter#146524)

flutter/engine@5a824e2...5dca50d

2024-04-09 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Delete engine v1 android embedding (flutter#51229)" (flutter/engine#51996)
2024-04-09 34871572+gmackall@users.noreply.github.com Delete engine v1 android embedding (flutter/engine#51229)
2024-04-09 flar@google.com better output from engine layer unit test failures (flutter/engine#51975)
2024-04-09 zanderso@users.noreply.github.com Revert "Roll Dart SDK from 78174b41ab0f to 7a5e410f982e (1 revision) (flutter#51980)" (flutter/engine#51990)
2024-04-09 jacksongardner@google.com [skwasm] Reify the SkPicture pointer as the right type. (flutter/engine#51991)
2024-04-09 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Roll Dart SDK from 7a5e410f982e to db99af14c4bc (1 revision) (flutter#51986)" (flutter/engine#51989)
2024-04-09 jason-simmons@users.noreply.github.com Move the Dart SDK to //flutter/third_party/dart (flutter/engine#51917)
2024-04-09 matej.knopp@gmail.com [macOS] Implement hit testing and handle platform view cursor changes (flutter/engine#43101)
2024-04-09 skia-flutter-autoroll@skia.org Roll Dart SDK from 7a5e410f982e to db99af14c4bc (1 revision) (flutter/engine#51986)
2024-04-09 skia-flutter-autoroll@skia.org Roll Dart SDK from 78174b41ab0f to 7a5e410f982e (1 revision) (flutter/engine#51980)

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 chinmaygarde@google.com,rmistry@google.com,zra@google.com 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants