Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[display_list] allow applying opacity peephole to single glyph. #53160

Merged
merged 4 commits into from
Jun 3, 2024

Conversation

jonahwilliams
Copy link
Member

A single glyph can be opacity peepholed, this is common in the case of Icons.

@jonahwilliams
Copy link
Member Author

FYI @flar , not sure if we have a standard harness for testing this sort of thing, or if you have cases somewhere for textblob I could expand to textframe.

@flar
Copy link
Contributor

flar commented Jun 1, 2024

dl_rendering_unittests.cc has some "compare with/without opacity" kinds of tests, but they don't run on Impeller. Would it be possible to create an Impeller golden test using DLBuilder? I thought that we recently got the DL playground tests to run as goldens.

@flar
Copy link
Contributor

flar commented Jun 1, 2024

Alternately, render it with an alpha color and render it with an alpha saveLayer and see if the two produce the same image. You can also check that the saveLayer DL reports can_distribute_opacity() as true on the DL object itself (as long as that one saveLayer is the only thing in it, it will indicate that it has correctly determined that the opacity can be peepholed)...

@jonahwilliams jonahwilliams marked this pull request as ready for review June 3, 2024 21:27
@jonahwilliams jonahwilliams requested a review from flar June 3, 2024 21:27
Copy link
Contributor

@flar flar left a comment

Choose a reason for hiding this comment

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

Looks good. I found a code inconsistency while reviewing the changes here, but this change didn't introduce it so I filed a follow-up bug for when we have time for the maintenance...

// likely a glyph used as an Icon)
const bool is_single_glyph = text_frame->GetRunCount() == 1u &&
text_frame->GetRuns()[0].GetGlyphCount() == 1u;
UpdateLayerOpacityCompatibility(is_single_glyph);
Copy link
Contributor

Choose a reason for hiding this comment

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

This reminds me that this code is mixing and matching attribute incompatibility with overlap incompatibility. Technically this is an overlap condition which is typically reported through the accumulator. But since this mistake is replicated in a few places I think that should be solved as a separate issue...

I filed this as flutter/flutter#149622

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, of note, this doesn't cause a bug, it's just a systemic logic confusion that ends up doing the right thing anyway.

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 3, 2024
@auto-submit auto-submit bot merged commit a338661 into flutter:main Jun 3, 2024
29 checks passed
@jonahwilliams jonahwilliams deleted the wide_peep_constraints branch June 3, 2024 22:17
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 4, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 4, 2024
@jonahwilliams
Copy link
Member Author

reason for revert: unexpected framework goldens https://flutter-gold.skia.org/search?issue=149634&crs=github&patchsets=4&corpus=flutter

@jonahwilliams jonahwilliams added the revert Label used to revert changes in a closed and merged pull request. label Jun 4, 2024
auto-submit bot pushed a commit that referenced this pull request Jun 4, 2024
@auto-submit auto-submit bot removed the revert Label used to revert changes in a closed and merged pull request. label Jun 4, 2024
auto-submit bot added a commit that referenced this pull request Jun 4, 2024
…ph. (#53160)" (#53189)

Reverts: #53160
Initiated by: jonahwilliams
Reason for reverting: unexpected framework goldens https://flutter-gold.skia.org/search?issue=149634&crs=github&patchsets=4&corpus=flutter
Original PR Author: jonahwilliams

Reviewed By: {flar}

This change reverts the following previous change:
A single glyph can be opacity peepholed, this is common in the case of Icons.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 4, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jun 4, 2024
…149658)

flutter/engine@a6aa5d8...e211c43

2024-06-04 [email protected] Roll Fuchsia Linux SDK from lKBLxel8iBaHpT5q6... to pagJoGS4kQ8Efa_if... (flutter/engine#53192)
2024-06-04 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[display_list] allow applying opacity peephole to single glyph. (#53160)" (flutter/engine#53189)
2024-06-04 [email protected] Roll Dart SDK from 49b5590c8d80 to 9dce57c343ec (1 revision) (flutter/engine#53187)
2024-06-04 [email protected] [Impeller] Use varying interpolation to compute some linear gradients. (flutter/engine#53166)
2024-06-03 [email protected] [Impeller] match rrect_blur math to the gaussian math (flutter/engine#53130)
2024-06-03 [email protected] [web] Add Ethiopic font fallback. (flutter/engine#53180)
2024-06-03 [email protected] Fix rendering corruption by Flutter and GDK sharing the same OpenGL context (flutter/engine#53103)
2024-06-03 [email protected] [display_list] allow applying opacity peephole to single glyph. (flutter/engine#53160)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from lKBLxel8iBaH to pagJoGS4kQ8E

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://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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants