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

[Impeller] Fix and reland drawPaint collapsing optimization. #43097

Merged
merged 3 commits into from
Jun 23, 2023

Conversation

gaaclarke
Copy link
Member

Collapses DrawPaint calls into clear colors when possible.

issue flutter/flutter#129292
relands #41711

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 Hixie said 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

@bdero bdero left a comment

Choose a reason for hiding this comment

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

LGTM!

@chinmaygarde chinmaygarde changed the title [Impeller] fix and reland drawPaint collapsing optimization [Impeller] Fix and reland drawPaint collapsing optimization. Jun 22, 2023
@gaaclarke gaaclarke added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 22, 2023
@flutter-dashboard
Copy link

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

Changes reported for pull request #43097 at sha 7848976

@gaaclarke
Copy link
Member Author

gaaclarke commented Jun 22, 2023

I checked the golden image results:

  1. CanRenderOffscreenCheckerboard - This doesn't reproduce locally, it looks like the save layer has a color that isn't transparent. I think we need to conditionally set the clear color instead of always setting it.
  2. CanRenderDestructiveSaveLayer - This is drawing wrong too, the correct drawing does not have a red background. Well have to figure out why that isn't blending correctly.

@gaaclarke
Copy link
Member Author

For the CanRenderOffscreenCheckerboard problem it was because when we call EntityPass::SetClearColor, that clear color was used as the clear color for every subpass in an entity pass. That test uses a multiply blend mode so the cream color would get multiplied, creating the error. I've updated it so that when you call EntityPass::SetClearColor, the clear color only applies to the offscreen_target. After typing this out though, this might fix Vulkan and break Metal since it isn't going down the same path. We'll see.

@gaaclarke
Copy link
Member Author

CanRenderDestructiveSaveLayer should be fixed by the same fix. It's difficult to know for sure, I think Skia Gold draws transparent black as white and locally we draw it as black.

@auto-submit
Copy link
Contributor

auto-submit bot commented Jun 23, 2023

auto label is removed for flutter/engine, pr: 43097, due to - The status or check suite Linux linux_web_engine has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 23, 2023
@gaaclarke gaaclarke merged commit 64a20eb into flutter:main Jun 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 23, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 23, 2023
fluttermirroringbot pushed a commit to flutter/flutter that referenced this pull request Jun 23, 2023
…129421)

flutter/engine@aca26b2...27f3498

2023-06-23 [email protected] Roll Dart SDK from 7b30bcd6207e to 81cdbe69a16b (2 revisions) (flutter/engine#43138)
2023-06-23 [email protected] Roll ANGLE from 16d65289e868 to 9211ebf1f2ac (1 revision) (flutter/engine#43137)
2023-06-23 [email protected] Roll Skia from a94abf80dd2f to 6ab865ee1f65 (1 revision) (flutter/engine#43135)
2023-06-23 [email protected] Roll Fuchsia Linux SDK from tcVndpnH_jzGm5LsJ... to VSKvLPB4DCIDvXzOA... (flutter/engine#43134)
2023-06-23 [email protected] Roll ANGLE from ac4f52c4f7ff to 16d65289e868 (1 revision) (flutter/engine#43133)
2023-06-23 [email protected] Roll Skia from 450bc21cc836 to a94abf80dd2f (2 revisions) (flutter/engine#43132)
2023-06-23 [email protected] Roll ANGLE from 4ed2d403a329 to ac4f52c4f7ff (2 revisions) (flutter/engine#43130)
2023-06-23 [email protected] Roll Skia from a989b6f1aec5 to 450bc21cc836 (2 revisions) (flutter/engine#43128)
2023-06-23 [email protected] Removed outdated comment from lib/ui/canvas.h (flutter/engine#43112)
2023-06-23 [email protected] Roll Dart SDK from 05d99585adab to 7b30bcd6207e (1 revision) (flutter/engine#43123)
2023-06-23 [email protected] Roll Skia from 6595192c8352 to a989b6f1aec5 (1 revision) (flutter/engine#43120)
2023-06-23 [email protected] Roll Fuchsia Mac SDK from Ylc35wOk0_j0NLzDv... to 07vKo_Vaiy_Vw2xxb... (flutter/engine#43119)
2023-06-23 [email protected] [Impeller] Include CPU blends + Flutter blend reference image in goldens (flutter/engine#43117)
2023-06-23 [email protected] [Impeller] Fix and reland drawPaint collapsing optimization. (flutter/engine#43097)
2023-06-23 [email protected] Roll Skia from 5265b5ee1afc to 6595192c8352 (1 revision) (flutter/engine#43116)
2023-06-22 [email protected] Roll Dart SDK from ecca5857b3ba to 05d99585adab (4 revisions) (flutter/engine#43113)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from tcVndpnH_jzG to VSKvLPB4DCID
  fuchsia/sdk/core/mac-amd64 from Ylc35wOk0_j0 to 07vKo_Vaiy_V

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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants