Repository navigation
Conversation
11 tasks
yexuan910812
pushed a commit
to yexuan910812/flutter
that referenced
this pull request
Oct 30, 2026
…188628) Related: flutter#187660. Part 1 of 5 from the original hybrid-rasterizer change. This PR is now limited to the independent benchmark instrumentation. Adds `presentation_duration` around preparation and frame submission, including asynchronous raster work, and records it in the web benchmark harness. The timer stops before reporting, and benchmark listeners are cleaned up even when startup fails. The existing profile JSON schema is unchanged. Verified locally: two engine timing tests cover enabled/disabled profiling and delayed preparation/rasterization; a browser regression test covers listener cleanup after synchronous startup failures. Static analysis and formatting pass. This change is independent of the hybrid rasterizer. The remaining pieces are separate drafts: - flutter#195103: native callback IDs and optional bitmap capture. - flutter#195104: platform-view DOM commit after rasterization. - flutter#195105: opt-in hybrid presentation, depending on the two changes above. - flutter#195106: desktop default policy and benchmark results, depending on the opt-in implementation. The duplicate semaphore and codec changes were dropped on rebase because master already includes flutter#194139 and flutter#193187. ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant in-code documentation (doc comments with `///`). - [ ] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). 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. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [AI contribution guidelines]: https://github.com/flutter/flutter/blob/main/CONTRIBUTING.ai.md [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [flutter/website]: https://github.com/flutter/website [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Zero marks an unset context-loss callback. Skip it when the shared uint32_t callback sequence wraps so context-loss notifications remain registered.
Keep canvases alive until pending rasterization finishes and clean up partially prepared frames. Handle platform-view removal during rasterization and keep staged presentation hooks with the hybrid rasterizer.
Merge current master while preserving disposed-frame cancellation and timing guards. Pass each queued render size through the rasterizer and update the platform-view regression helper for the required size argument.
Integrate upstream render sizes and deferred platform-view publication. Verify placeholder pixels independently of animation callbacks, clear stale readback pixels, and release GPU resources in their owning contexts. Dispatch context-loss notifications without dereferencing a disposed surface. Add regression coverage for unavailable placeholders, delayed animation callbacks, context disposal, and explicit DPR in platform-view coordinate tests.
Integrate the updated opt-in implementation while retaining the desktop defaults for WebKit, Firefox, and single-threaded Chromium. Multi-threaded Chromium, mobile platforms, and Wimp continue to require explicit opt-in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #187660. Part 5 of 5, split from #188628. Depends on #195105; this draft includes the prerequisite commits. The default-policy change is f4a67610a217. It stays draft until the opt-in implementation lands.
Enables hybrid presentation by default on desktop Safari/Firefox and desktop Chrome ST. Chrome MT, mobile, and Wimp remain opt-in. Explicit
skwasmUseHybridRasterizersettings override the default, and lack of transferred-canvas support keeps bitmap rendering.Measurements against master 18aa6807735a, with the timing recorder from #188628, use 72 runs (36 bitmap/hybrid pairs) and 7,200 measured samples on an M2 Pro Mac mini. These measure engine presentation duration, not displayed FPS. Chrome MT improved in this campaign, but stays opt-in because the earlier candidate/browser version regressed on text. This revision has not been requalified on physical mobile devices.
Full benchmark table
Medians of three per-run averages; microseconds, lower is better. Chrome 155, Safari 27, Firefox 148 on macOS 27. Each run confirmed its intended presentation path and reported no application errors.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot 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.