Repository navigation
Revert: Only render views that need to be rendered (with external texture & platform view support) - #191252
Conversation
…ture & platform view support) (flutter#179874)" This reverts commit e11a342.
There was a problem hiding this comment.
Code Review
This pull request removes the onTextureFrameAvailable and onMarkAllViewsNeedRender callbacks from PlatformDispatcher and the engine, along with the associated needsCompositeFrame and markNeedsCompositeFrame logic in RenderView and PipelineOwner. Instead of notifying the framework of individual texture frame availability or marking views as needing compositing, the engine now schedules frames directly. Corresponding tests, unused imports, and callbacks have been cleaned up or removed across the engine, framework, and web UI. I have no feedback to provide on these changes.
|
Detected the If you add the The "Merge" button is also unlocked. To bypass presubmits as well as the tree status, press the GitHub "Add to Merge Queue". |
This relands flutter#179874, reverted in flutter#191252. The reason for revert was stalled web benchmarks (flutter#191251). Stalling was caused by `_autoUpdateBenchmarkPhase` inside `macrobenchmarks/lib/src/web/recorder.dart` expecting certain number of `preroll_frame` and `apply_frame` events. These events are only published for frames that are composited (ui.Scene being rendered), but some of the web benchmarks request frame without making any render objects dirty, which after flutter#191252 did not result on view being composited. The fix is to force view composition on every frame when the benchmarks are running. cc @yjbanov regarding the changes in `recorder.dart`. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant in-code documentation (doc comments with `///`). - [x] 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). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] 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/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [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 --------- Co-authored-by: Jon Ihlas <[email protected]> Co-authored-by: Jon Ihlas <[email protected]>
Reverts: [Reland: Only render views that need to be rendered ](#192128) Initiated by: @elliette Reason for reverting: broke flutter -> packages autoroller Original PR Author: @knopp Reviewed By: @loic-sharma The original PR description is provided below: This relands #179874, reverted in #191252. The reason for revert was stalled web benchmarks (#191251). Stalling was caused by `_autoUpdateBenchmarkPhase` inside `macrobenchmarks/lib/src/web/recorder.dart` expecting certain number of `preroll_frame` and `apply_frame` events. These events are only published for frames that are composited (ui.Scene being rendered), but some of the web benchmarks request frame without making any render objects dirty, which after #191252 did not result on view being composited. The fix is to force view composition on every frame when the benchmarks are running. cc @yjbanov regarding the changes in `recorder.dart`. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant in-code documentation (doc comments with `///`). - [x] 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). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] 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/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines [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 Co-authored-by: Elliott Brooks <[email protected]>
Reverts: Only render views that need to be rendered (with external texture & platform view support)
Initiated by: @flar
Reason for reverting: #191251
Original PR Author: @9AZX
Reviewed By: @knopp
The original PR description is provided below:
Fixes #164320
Based on @knopp work in #164322
This PR adds a dirty-view compositing optimization that skips compositing for views that don't have any dirty render objects, so it should improves performance in multi-view scenarios by avoiding unnessacery work.
When a texture has new content, the framework now gets notified via a new onTextureFrameAvailable callback from the engine. This marks the texture's render object as needing paint, so its view is included in compositing even when nothing else changed.
On Android, texture callbacks now use
markTextureFrameAvailableinstead ofscheduleEngineFrame. This is actually more efficient since it reuses the existing layer tree rather than regenerating it. Other platforms already used the correct path.It also forces all views to composite when returning from background, ensuring the display is properly refreshed after the app was paused.
On MacOS:
Screen.Recording.2025-12-15.at.11.54.17.mov
Pre-launch Checklist
///).