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

Conversation

@ajihyf
Copy link
Contributor

@ajihyf ajihyf commented Sep 9, 2023

Description

This PR fixes the gl_populate_existing_damage in embedder.cc, which currently returns an empty rectangle when a full repaint is needed. This leads to the frame_damage being considered empty in rasterizer.cc, causing incorrect partial repaint within Flutter when gl_populate_existing_damage is not provided by the embedder.

Related Issue

flutter/flutter#119601

Tests

Add a new test. Also fixes damage calculation related tests in EmbedderTest by

  • Use a new Dart embedder fixture entry point render_gradient_retained which retains the old layer to make sure layer tree diff happens.
  • Add latch.Wait() after SetGLPresentCallback to make sure assertions have been executed.
  • Make existing_damage_rects static since it should be valid after populate_existing_damage returns.

@ajihyf ajihyf force-pushed the fix-embedder-damage branch 2 times, most recently from 92bb9ae to 4d805dc Compare September 13, 2023 11:31
@makotosato-at
Copy link

Thanks for raising this, I facing same problem.
I hope it will be merged soon.

@ajihyf ajihyf force-pushed the fix-embedder-damage branch 2 times, most recently from 82e8b3d to a518c0b Compare September 14, 2023 15:19
@chinmaygarde
Copy link
Member

This looks like a sound change. Perhaps @knopp can also review?

existing_damage_rect = SkIRect::MakeEmpty();
partial_repaint_enabled = false;
} else if (existing_damage.num_rects > 1) {
// Log message notifying users that multi-damage is not yet available in
Copy link
Member

@knopp knopp Sep 21, 2023

Choose a reason for hiding this comment

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

Maybe we should join the rectangles here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. Also added one more test.

@ajihyf
Copy link
Contributor Author

ajihyf commented Sep 26, 2023

Linux Framework Smoke Tests has been cancelled because of timeout. It seems like an infra issue. I have no permission to rerun the build, could you please help me to rerun it? @chinmaygarde @knopp

@HidenoriMatsubayashi
Copy link
Member

Thanks for doing this @ajihyf . How about rebasing the change? It should trigger the CI tests.

@ajihyf ajihyf force-pushed the fix-embedder-damage branch from a3ddee6 to 49337d5 Compare September 27, 2023 06:12
@chinmaygarde chinmaygarde added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 28, 2023
@auto-submit auto-submit bot merged commit 789fbee into flutter:main Sep 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Sep 28, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Sep 28, 2023
…135717)

flutter/engine@cc7c3c1...485543c

2023-09-28 [email protected] Roll Fuchsia Linux SDK from cu6apvEZ2P6zhishc... to l2RxJKPfYn7QzGOoL... (flutter/engine#46382)
2023-09-28 [email protected] Remove opacity layer dcheck. (flutter/engine#46160)
2023-09-28 [email protected] Add initial support for 4x MSAA in OpenGLES backend. (flutter/engine#46381)
2023-09-28 [email protected] Reland: [macOS] performKeyEquivalent cleanup (flutter/engine#46377)
2023-09-28 [email protected] [macOS] TextInputPlugin should mark navigation events in IME popover as handled (flutter/engine#46141)
2023-09-28 [email protected] Removed unnecessary dynamic dispatch (flutter/engine#46369)
2023-09-28 [email protected] [Impeller] Fix OpenGLES EGL_BAD_ACCESS due to context being current on multiple threads. (flutter/engine#46287)
2023-09-28 [email protected] Fix damage calculation when not providing populate_existing_damage for gl embedder (flutter/engine#45611)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from cu6apvEZ2P6z to l2RxJKPfYn7Q

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 [email protected],[email protected],[email protected] 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@ajihyf ajihyf deleted the fix-embedder-damage branch September 30, 2023 12:25
Mairramer pushed a commit to Mairramer/flutter that referenced this pull request Oct 10, 2023
…lutter#135717)

flutter/engine@cc7c3c1...485543c

2023-09-28 [email protected] Roll Fuchsia Linux SDK from cu6apvEZ2P6zhishc... to l2RxJKPfYn7QzGOoL... (flutter/engine#46382)
2023-09-28 [email protected] Remove opacity layer dcheck. (flutter/engine#46160)
2023-09-28 [email protected] Add initial support for 4x MSAA in OpenGLES backend. (flutter/engine#46381)
2023-09-28 [email protected] Reland: [macOS] performKeyEquivalent cleanup (flutter/engine#46377)
2023-09-28 [email protected] [macOS] TextInputPlugin should mark navigation events in IME popover as handled (flutter/engine#46141)
2023-09-28 [email protected] Removed unnecessary dynamic dispatch (flutter/engine#46369)
2023-09-28 [email protected] [Impeller] Fix OpenGLES EGL_BAD_ACCESS due to context being current on multiple threads. (flutter/engine#46287)
2023-09-28 [email protected] Fix damage calculation when not providing populate_existing_damage for gl embedder (flutter/engine#45611)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from cu6apvEZ2P6z to l2RxJKPfYn7Q

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 [email protected],[email protected],[email protected] 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
harryterkelsen pushed a commit that referenced this pull request Oct 23, 2023
…r gl embedder (#45611)

# Description

This PR fixes the `gl_populate_existing_damage` in embedder.cc, which currently returns an empty rectangle when a full repaint is needed. This leads to the `frame_damage` being considered empty in rasterizer.cc, causing incorrect partial repaint within Flutter when `gl_populate_existing_damage` is not provided by the embedder.

# Related Issue

flutter/flutter#119601

# Tests

Add a new test. Also fixes damage calculation related tests in EmbedderTest by

* Use a new Dart embedder fixture entry point `render_gradient_retained` which retains the old layer to make sure layer tree diff happens.
* Add `latch.Wait()` after `SetGLPresentCallback` to make sure assertions have been executed.
* Make `existing_damage_rects` static since it should be valid after `populate_existing_damage` returns.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App platform-android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants