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

Conversation

@jtmcdole
Copy link
Member

@jtmcdole jtmcdole commented Jul 8, 2024

Fixes flutter/flutter#151210 by premultiplying alpha in the rare case we get straight alpha.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@jtmcdole jtmcdole requested a review from jonahwilliams July 8, 2024 23:28
@jtmcdole
Copy link
Member Author

jtmcdole commented Jul 8, 2024

I will write a golden test in the morning.

jtmcdole added 2 commits July 9, 2024 08:55
Fixes #151210 by premultiplying alpha in the rare case we get
straight alpha.
Comment on lines +220 to +225
// readPixels() handles converting pixels to premultiplied form.
bitmap->readPixels(premul_bitmap->pixmap());
premul_bitmap->setImmutable();
bitmap_allocator = premul_allocator;
bitmap = premul_bitmap;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

So this code here is creating a new bitmap, writing the contents and applying the premultiplication to the old bitmap, then overwriting the local so we only refer to the new bitmap.

Seems reasonable!

Copy link
Contributor

@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!

@jtmcdole jtmcdole merged commit 78c22da into flutter:main Jul 10, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 10, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 10, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 10, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 10, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 10, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 10, 2024
…151522)

flutter/engine@371db85...db2b45b

2024-07-10 [email protected] [Impeller] Fix markdown formatting for blocks with tips. (flutter/engine#53789)
2024-07-10 98614782+auto-submit[bot]@users.noreply.github.com Reverts "dart:ui - drop deprecated hash functions (#53787)" (flutter/engine#53794)
2024-07-10 98614782+auto-submit[bot]@users.noreply.github.com Reverts "web_ui: drop internal hash code library (#53783)" (flutter/engine#53793)
2024-07-10 [email protected] Manual roll Dart SDK from ffc8bb004a64 to dba0dfbd06eb (23 revisions) (flutter/engine#53791)
2024-07-10 [email protected] Impeller really wants premultiplied alpha (flutter/engine#53770)
2024-07-09 [email protected] dart:ui - drop deprecated hash functions (flutter/engine#53787)
2024-07-09 [email protected] [Impeller] Validation errors in tests cause GTest failures. (flutter/engine#53786)
2024-07-09 [email protected] [Impeller] Update docs that specify how to select the Impeller backend. (flutter/engine#53788)

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

Some PNG transparent images have rendering issues on iOS.

2 participants