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

Do not disable partial repaint based on thread merging state #54219

Merged
merged 1 commit into from
Jul 30, 2024

Conversation

knopp
Copy link
Member

@knopp knopp commented Jul 30, 2024

Currently we force full repaint when thread merging is detected, but that is not a good way to determine whether platform view is in hierarchy when thread merging is no longer needed. Alternative solution here makes the PlatformViewLayer force full repaint when diffing.

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.

Copy link
Member

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM

@knopp knopp merged commit 3b9c31f into flutter:main Jul 30, 2024
26 checks passed
@knopp knopp deleted the partial_repaint_platform_views branch July 30, 2024 19:36
@jonahwilliams
Copy link
Member

I think I found an issue with this, sorry for not realizing during the review. We actually need to wait for one frame after the platform view is removed from the scene. Because that last frame is transitional and required for removing the PVs, and will result in the diff being incorrect.

@jonahwilliams
Copy link
Member

reason for revert: incorrect rendering on last frame after platform view is removed.

@jonahwilliams jonahwilliams added the revert Label used to revert changes in a closed and merged pull request. label Jul 30, 2024
auto-submit bot pushed a commit that referenced this pull request Jul 30, 2024
@auto-submit auto-submit bot removed the revert Label used to revert changes in a closed and merged pull request. label Jul 30, 2024
auto-submit bot added a commit that referenced this pull request Jul 30, 2024
…#54219)" (#54230)

Reverts: #54219
Initiated by: jonahwilliams
Reason for reverting: incorrect rendering on last frame after platform view is removed.
Original PR Author: knopp

Reviewed By: {jonahwilliams}

This change reverts the following previous change:
Currently we force full repaint when thread merging is detected, but that is not a good way to determine whether platform view is in hierarchy when thread merging is no longer needed. Alternative solution here makes the PlatformViewLayer  force full repaint when diffing.

[C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
@knopp
Copy link
Member Author

knopp commented Jul 30, 2024

That makes sense :-/ When removing the view, if nothing else changes, we remove the overlay surface but do not repaint the base layer. Missed that when testing.

The solution would be to make the paint region of the platform view layer covering the whole frame, instead of simply modifying the damage_ rect. That way when the view layer is removed, the previous area covered by the layer is automatically marked as dirty, forcing whole repaint for the next frame.

@knopp
Copy link
Member Author

knopp commented Jul 30, 2024

Should be fixed by 34b2827. I'll write a test for this tomorrow and will make a new PR.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 30, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 30, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 30, 2024
…152583)

flutter/engine@a4b88a3...08f9be3

2024-07-30 chris@bracken.jp [iOS] Delete unused create_ios_framework.py (flutter/engine#54227)
2024-07-30 skia-flutter-autoroll@skia.org Roll Skia from b9b208f11c67 to 4e31906b6312 (1 revision) (flutter/engine#54226)
2024-07-30 jonahwilliams@google.com [engine] Split encode and submit into two different surface frame callbacks. (flutter/engine#54200)
2024-07-30 matej.knopp@gmail.com Do not disable partial repaint based on thread merging state (flutter/engine#54219)
2024-07-30 skia-flutter-autoroll@skia.org Roll Dart SDK from 14b51d32e3a6 to e16dc217b1ac (1 revision) (flutter/engine#54221)

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
knopp added a commit that referenced this pull request Aug 7, 2024
Relands #54219 reverted in
#54230.

The tracked area of `PlatformViewLayer` now covers entire frame ensuring
full repaint when platform view is removed.
Added `FullRepaintAfterRemovingLayer` test.

## 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 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
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[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
TytaniumDev pushed a commit to TytaniumDev/flutter that referenced this pull request Aug 7, 2024
…lutter#152583)

flutter/engine@a4b88a3...08f9be3

2024-07-30 chris@bracken.jp [iOS] Delete unused create_ios_framework.py (flutter/engine#54227)
2024-07-30 skia-flutter-autoroll@skia.org Roll Skia from b9b208f11c67 to 4e31906b6312 (1 revision) (flutter/engine#54226)
2024-07-30 jonahwilliams@google.com [engine] Split encode and submit into two different surface frame callbacks. (flutter/engine#54200)
2024-07-30 matej.knopp@gmail.com Do not disable partial repaint based on thread merging state (flutter/engine#54219)
2024-07-30 skia-flutter-autoroll@skia.org Roll Dart SDK from 14b51d32e3a6 to e16dc217b1ac (1 revision) (flutter/engine#54221)

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
Buchimi pushed a commit to Buchimi/flutter that referenced this pull request Sep 2, 2024
…lutter#152583)

flutter/engine@a4b88a3...08f9be3

2024-07-30 chris@bracken.jp [iOS] Delete unused create_ios_framework.py (flutter/engine#54227)
2024-07-30 skia-flutter-autoroll@skia.org Roll Skia from b9b208f11c67 to 4e31906b6312 (1 revision) (flutter/engine#54226)
2024-07-30 jonahwilliams@google.com [engine] Split encode and submit into two different surface frame callbacks. (flutter/engine#54200)
2024-07-30 matej.knopp@gmail.com Do not disable partial repaint based on thread merging state (flutter/engine#54219)
2024-07-30 skia-flutter-autoroll@skia.org Roll Dart SDK from 14b51d32e3a6 to e16dc217b1ac (1 revision) (flutter/engine#54221)

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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants