-
Notifications
You must be signed in to change notification settings - Fork 29.2k
[reland][web] Refactor renderers to use the same frontend code #174588 #175392
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
[reland][web] Refactor renderers to use the same frontend code #174588 #175392
Conversation
88bce57
to
f40cdc0
Compare
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.
Code Review
This pull request introduces a major refactoring to unify the rendering code for the Skwasm and CanvasKit web renderers. The changes are extensive, moving shared logic into a common Renderer
base class and abstracting backend-specifics into Rasterizer
implementations. This unification also involves removing old scene building logic and replacing it with a new shared implementation. Additionally, the testing infrastructure is updated to support different build modes. The changes are well-structured and consistent with the goal of renderer unification. A positive side-effect of this work is that many tests previously skipped for Skwasm are now enabled, indicating better feature parity. The overall code quality is high, and I found no issues in this large but well-executed refactoring.
9225a9b
to
249f31b
Compare
@mdebbar PTAL This is a reland of #174588 with some tweaks to fix the bugs that were discovered which caused us to revert the original PR. The changes from the original PR are small. They can be found in There is another change to address a crash which was discovered in Google3 which happens if a frame is pumped with an empty viewport, which causes the renderer to early-exit out of rendering, but without populating the fields in the FrameTimingRecorder, which caused a crash when we tried to submit timings. This is fixed in |
249f31b
to
402ec43
Compare
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.
Looks great! I hope it sticks this time 🤞
dev/benchmarks/macrobenchmarks/lib/src/web/bench_mouse_region_grid_hover.dart
Outdated
Show resolved
Hide resolved
dev/benchmarks/macrobenchmarks/lib/src/web/bench_mouse_region_mixed_grid_hover.dart
Outdated
Show resolved
Hide resolved
...ne/src/flutter/lib/web_ui/lib/src/engine/skwasm/skwasm_impl/offscreen_canvas_rasterizer.dart
Outdated
Show resolved
Hide resolved
402ec43
to
0b06430
Compare
Fix commits that are a result of bad merge Trigger rebuild Unify web renderers Refactor debug JSON helpers. Make _kickRenderLoop use a while loop remove unused import
0b06430
to
c2611c4
Compare
Refactors the renderer code so both renderers (Skwasm and CanvasKit) use the same SceneBuilder and platform view embedding code. This change is discussed in a design doc here: https://flutter.dev/go/web-renderer-unification
Fixes #172311
Fixes #172308
Fixes #142072
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assist
bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.