Skip to content

Revert: Only render views that need to be rendered (with external texture & platform view support) - #191252

Merged
auto-submit[bot] merged 1 commit into
flutter:masterfrom
flutteractionsbot:revert-179874-1787045818
Aug 18, 2026
Merged

auto-submit[bot] merged 1 commit into
flutter:masterfrom
flutteractionsbot:revert-179874-1787045818

Conversation

@flutteractionsbot

Copy link
Copy Markdown
Contributor

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 markTextureFrameAvailable instead of scheduleEngineFrame. 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

  • 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], 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 documentation (doc comments with ///).
  • 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.

@flutteractionsbot
flutteractionsbot requested a review from a team as a code owner August 18, 2026 09:37
@flutteractionsbot
flutteractionsbot requested review from reidbaker and removed request for a team August 18, 2026 09:37
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 18, 2026
@github-actions github-actions Bot added platform-android Android applications specifically framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-android Owned by Android platform team team-web Owned by Web platform team labels Aug 18, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 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.

@flar flar added the emergency Jump the queue; land PR in front of all others; only use for emergencies label Aug 18, 2026
@flutter-dashboard

Copy link
Copy Markdown

Detected the emergency label.

If you add the autosubmit label, the bot will wait until all presubmits pass but ignore the tree status, allowing fixes for tree breakages while still validating that they don't break any existing presubmits.

The "Merge" button is also unlocked. To bypass presubmits as well as the tree status, press the GitHub "Add to Merge Queue".

pull Bot pushed a commit to safarmer/flutter that referenced this pull request Sep 24, 2026
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]>
github-merge-queue Bot pushed a commit that referenced this pull request Sep 28, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD emergency Jump the queue; land PR in front of all others; only use for emergencies engine flutter/engine related. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically platform-web Web applications specifically team-android Owned by Android platform team team-web Owned by Web platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Multiview] Flutter re-renders all views during each update

3 participants