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

[canvaskit] Enable multiview rendering #48301

Merged

Conversation

harryterkelsen
Copy link
Contributor

Allows the CanvasKitRenderer to render into multiple views.

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.

@github-actions github-actions bot added the platform-web Code specifically for the web engine label Nov 22, 2023
/// Returns the [Rasterizer] that has been created for the given [view].
/// Used in tests.
Rasterizer debugGetRasterizerForView(EngineFlutterView view) {
return _getRasterizerForView(view);
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 look in the map directly? Delegating to _getRasterizerForView will actually end up creating a new rasterizer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No because the test which uses this needs to get a hold of the Rasterizer before the first time renderScene is called so it isn't created yet.

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 if CI is happy! Minor comments, and a question raised by @goderbauer during the view resizing work!

Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

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

lgtm

https://skia.googlesource.com/skia.git/+log/3a79d7a618aa..5606ef899116

2023-11-22 jvanverth@google.com Reland "[graphite] Use colorspace matrix to handle RGB swizzle."

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jamesgk@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
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
- Auto-generate view IDs.
- Views don't auto-register/auto-unregister anymore.
- Remove `EnginePlatformDispatcher.registerView/unregisterView` methods.
- Add `FlutterViewManager.createAndRegisterView/disposeAndUnregisterView/dispose` methods.
- Hook the `addView`/`removeView` JS APIs to `FlutterViewManager`.
…... (flutter#48338)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-linux-sdk-flutter-engine
Please CC jacksongardner@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
skia-flutter-autoroll and others added 16 commits November 27, 2023 10:31
)

https://skia.googlesource.com/skia.git/+log/b18b594b230d..0eea0b277d7d

2023-11-26 johnstiles@google.com Use SkToInt to avoid warning in Flutter roll.
2023-11-26 skia-recreate-skps@skia-swarming-bots.iam.gserviceaccount.com Update SKP version
2023-11-26 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 2e96f5c2b566 to 860dca03b6e7 (1 revision)
2023-11-26 bungeman@google.com IWYU for modules/skshaper
2023-11-25 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 95073d786075 to 2e96f5c2b566 (1 revision)
2023-11-24 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 2ddf0aa40843 to 95073d786075 (2 revisions)
2023-11-24 johnstiles@google.com Avoid combining extremely large meshes.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jcgregorio@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
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
…... (flutter#48389)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/fuchsia-linux-sdk-flutter-engine
Please CC jacksongardner@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
… support (flutter#48388)

This extension only implies decal support for OES textures. Remove it from the check for generic decal support.

In practice i think it would be unlikely that a driver supports this and not regular decal, but that would only make the bugs this may cause even harder to track down.
…ter#48288)

Don't branch on uniform for decal support in GLES backend.
…e. (flutter#48386)

Now rendering textured 3D models!

* Combined depth+stencil attachment.
* Allow for multiple color attachments.
* Add blend mode configuration.
* Fix uniform ordering for vertex shaders.
* Texture binding and sampling options.
* Index buffer binding.
* Depth configuration.
)

https://skia.googlesource.com/skia.git/+log/0eea0b277d7d..b3e896c2f9bf

2023-11-27 skia-autoroll@skia-public.iam.gserviceaccount.com Roll SK Tool from df6df054b2af to 19a06c962732
2023-11-27 skia-autoroll@skia-public.iam.gserviceaccount.com Roll Dawn from d45b02c819f7 to 2a21ac0c3b4f (21 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jcgregorio@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
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
https://skia.googlesource.com/skia.git/+log/b3e896c2f9bf..2bf9afca2bc1

2023-11-27 skia-autoroll@skia-public.iam.gserviceaccount.com Roll vulkan-deps from 860dca03b6e7 to fab2f1d6619c (1 revision)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jcgregorio@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
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
https://skia.googlesource.com/skia.git/+log/2bf9afca2bc1..9fa62ccefe59

2023-11-27 skia-autoroll@skia-public.iam.gserviceaccount.com Roll ANGLE from aa3bebf94d2f to 9a70fc904664 (4 revisions)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jcgregorio@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
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
…utter#43301)

Fixes flutter/flutter#129710
Fixes flutter/flutter#138936

Implements https://flutter.dev/go/optimized-platform-view-layers

## Example

This scene would normally require 5 surfaces, but with the PR it comes
down to 2 (when drawing over platform views) and 1 when all drawing is
outside of platform views).


https://github.com/flutter/flutter/assets/96958/091da832-bfbc-44a2-8da5-d55d84024c96

*If you had to change anything in the [flutter/tests] repo, include a
link to the migration guide as per the [breaking change policy].*

## Pre-launch Checklist

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

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

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
https://skia.googlesource.com/skia.git/+log/9fa62ccefe59..5f0832787d0f

2023-11-27 lovisolo@google.com [bazel] Move //bazel/configs/devicesrc to //bazel/devicesrc.

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jcgregorio@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
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
https://skia.googlesource.com/skia.git/+log/5f0832787d0f..b0d81aba3f78

2023-11-27 robertphillips@google.com [graphite] Auto-set the protectedness of Devices

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jcgregorio@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
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
…flutter#48402)

Manual roll requested by zra@google.com

https://dart.googlesource.com/sdk.git/+log/f1fd14505782..c9bdb5884670

2023-11-23 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-162.0.dev
2023-11-23 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-161.0.dev
2023-11-23 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-160.0.dev
2023-11-22 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-159.0.dev
2023-11-22 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-158.0.dev
2023-11-21 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-157.0.dev
2023-11-21 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-156.0.dev
2023-11-21 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-155.0.dev
2023-11-21 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-154.0.dev
2023-11-21 dart-internal-merge@dart-ci-internal.iam.gserviceaccount.com Version 3.3.0-153.0.dev

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-sdk-flutter-engine
Please CC dart-vm-team@google.com,jacksongardner@google.com,zra@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Flutter Engine: 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
)

https://skia.googlesource.com/skia.git/+log/b0d81aba3f78..743fc1cde518

2023-11-27 briansalomon@gmail.com Reland "[graphite] Add no-yield option to ContextOptions."
2023-11-27 kjlubick@google.com Explicitly set defines for FontMgrs in G3
2023-11-27 nicolettep@google.com Reland "[graphite] Implement AHardwareBuffer BackendTexture creation for Vulkan"

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jcgregorio@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
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
)

https://skia.googlesource.com/skia.git/+log/743fc1cde518..4c964f8c4738

2023-11-27 bevilacquajoey@gmail.com SkSVGDevice: don't skip fill-opacity when fill is black
2023-11-27 robertphillips@google.com [graphite] Add Graphite variants of VkProtectedContext tests

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/skia-flutter-autoroll
Please CC brianosman@google.com,jacksongardner@google.com,jcgregorio@google.com,rmistry@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Skia: https://bugs.chromium.org/p/skia/issues/entry
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 harryterkelsen merged commit 37002c3 into flutter:main Nov 27, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 27, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 27, 2023
…139103)

flutter/engine@0a098bd...2be7191

2023-11-27 goderbauer@google.com Dynamic view sizing [dart:ui] (flutter/engine#48090)
2023-11-27 dnfield@google.com Roll shaderc to google/shaderc@37e2553 (flutter/engine#48415)
2023-11-27 skia-flutter-autoroll@skia.org Roll Skia from 4c964f8c4738 to 600986ba305d (6 revisions) (flutter/engine#48419)
2023-11-27 1961493+harryterkelsen@users.noreply.github.com [canvaskit] Enable multiview rendering (flutter/engine#48301)
2023-11-27 30870216+gaaclarke@users.noreply.github.com [Impeller] updated gaussian blur tests to use device private textures (flutter/engine#48417)

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 jacksongardner@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
caseycrogers pushed a commit to caseycrogers/flutter that referenced this pull request Dec 29, 2023
…lutter#139103)

flutter/engine@0a098bd...2be7191

2023-11-27 goderbauer@google.com Dynamic view sizing [dart:ui] (flutter/engine#48090)
2023-11-27 dnfield@google.com Roll shaderc to google/shaderc@37e2553 (flutter/engine#48415)
2023-11-27 skia-flutter-autoroll@skia.org Roll Skia from 4c964f8c4738 to 600986ba305d (6 revisions) (flutter/engine#48419)
2023-11-27 1961493+harryterkelsen@users.noreply.github.com [canvaskit] Enable multiview rendering (flutter/engine#48301)
2023-11-27 30870216+gaaclarke@users.noreply.github.com [Impeller] updated gaussian blur tests to use device private textures (flutter/engine#48417)

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 jacksongardner@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
platform-web Code specifically for the web engine
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

8 participants