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

[web:multiview] Make CanvasKitRenderer listen for view creation/disposal events #48812

Conversation

harryterkelsen
Copy link
Contributor

Makes CanvasKitRenderer create and dispose of views by listening to events from the PlatformViewManager instance.

Fixes flutter/flutter#137073

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@harryterkelsen harryterkelsen requested a review from ditman December 8, 2023 00:26
@github-actions github-actions bot added the platform-web Code specifically for the web engine label Dec 8, 2023
Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for adding the creation/disposal streams!

@@ -61,6 +61,8 @@ void testMain() {
reason: 'The slot reenables pointer events.');
expect(contentsHost.getAttribute('slot'), slot.getAttribute('name'),
reason: 'The contents and slot are correctly related.');

await disposePlatformView(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it makes more sense to have this here, since creating and adding of platformView 0 happened in the test body too!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change was required since I no longer dispose of the Renderer between each test

@ditman
Copy link
Member

ditman commented Dec 11, 2023

This still LGTM! Also Mouad is adding all the onResize logic to the view, so I can remove my changes from the ViewManager that conflict with yours :P

Much cleaner now!

@harryterkelsen harryterkelsen merged commit f8777f5 into flutter:main Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 13, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 13, 2023
…140084)

flutter/engine@9039ac7...fc32677

2023-12-13 jason-simmons@users.noreply.github.com Revert Dart SDK back to 3.3.0-219.0.dev (flutter/engine#48990)
2023-12-13 flar@google.com [Impeller] Use direct tessellation geometry for simple clip shapes (flutter/engine#48959)
2023-12-13 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[Android] Re-land "Add target to have linux_android_emulator_tests run on AVDs with Android 33 & 34"" (flutter/engine#48988)
2023-12-13 31859944+LongCatIsLooong@users.noreply.github.com Add a constructor for `GlyphInfo`. (flutter/engine#48971)
2023-12-13 737941+loic-sharma@users.noreply.github.com [Windows] Refactor surface manager mocking (flutter/engine#48953)
2023-12-13 skia-flutter-autoroll@skia.org Roll Skia from 6e5bd9b1d91d to f3401c6186c1 (2 revisions) (flutter/engine#48981)
2023-12-13 skia-flutter-autoroll@skia.org Roll Skia from 1e63c048ded7 to 6e5bd9b1d91d (1 revision) (flutter/engine#48973)
2023-12-13 skia-flutter-autoroll@skia.org Roll Skia from 927f20598b11 to 1e63c048ded7 (1 revision) (flutter/engine#48968)
2023-12-13 skia-flutter-autoroll@skia.org Roll Dart SDK from 17143c130ab3 to 114f2e8de3e5 (1 revision) (flutter/engine#48969)
2023-12-13 jason-simmons@users.noreply.github.com Workarounds for clang-tidy warnings in the next roll of Clang (flutter/engine#48963)
2023-12-13 matanlurey@users.noreply.github.com Migrate `impeller/**.h` to header guards. (flutter/engine#48962)
2023-12-13 skia-flutter-autoroll@skia.org Roll Dart SDK from 02f28120470f to 17143c130ab3 (1 revision) (flutter/engine#48961)
2023-12-13 43054281+camsim99@users.noreply.github.com [Android] Re-land "Add target to have linux_android_emulator_tests run on AVDs with Android 33 & 34" (flutter/engine#48936)
2023-12-13 skia-flutter-autoroll@skia.org Roll Skia from 49e32eb178a7 to 927f20598b11 (3 revisions) (flutter/engine#48956)
2023-12-13 1961493+harryterkelsen@users.noreply.github.com [web:multiview] Make CanvasKitRenderer listen for view creation/disposal events (flutter/engine#48812)
2023-12-12 matanlurey@users.noreply.github.com Move `third_party/swiftshader`, roll buildroot `DEPS`. (flutter/engine#48946)
2023-12-12 flar@google.com [Impeller] Direct tessellation of simple filled round rects (flutter/engine#48919)
2023-12-12 skia-flutter-autoroll@skia.org Roll Skia from 8e8d92ac1536 to 49e32eb178a7 (1 revision) (flutter/engine#48949)
2023-12-12 skia-flutter-autoroll@skia.org Roll Dart SDK from a677378ae254 to 02f28120470f (1 revision) (flutter/engine#48945)
2023-12-12 skia-flutter-autoroll@skia.org Roll Skia from 43a400456ab4 to 8e8d92ac1536 (1 revision) (flutter/engine#48941)
2023-12-12 skia-flutter-autoroll@skia.org Roll Skia from 3678212a85b8 to 43a400456ab4 (2 revisions) (flutter/engine#48939)
2023-12-12 matanlurey@users.noreply.github.com Roll `buildroot` and delete `libxml`. (flutter/engine#48906)
2023-12-12 skia-flutter-autoroll@skia.org Roll Skia from 16298087c277 to 3678212a85b8 (2 revisions) (flutter/engine#48934)
2023-12-12 jason-simmons@users.noreply.github.com Manual roll of Dart SDK from 82c4571bb2de to a677378ae254 (flutter/engine#48933)
2023-12-12 skia-flutter-autoroll@skia.org Roll Skia from 7685acfb6221 to 16298087c277 (1 revision) (flutter/engine#48931)
2023-12-12 mdebbar@google.com [web] Handle resizes at the view level (flutter/engine#48892)

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 jsimmons@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
@harryterkelsen
Copy link
Contributor Author

This actually fixed flutter/flutter#138926

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform-web Code specifically for the web engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enforce the rendering rule
2 participants