-
Notifications
You must be signed in to change notification settings - Fork 6k
Impeller really wants premultiplied alpha #53770
Conversation
|
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. |
|
I will write a golden test in the morning. |
Fixes #151210 by premultiplying alpha in the rare case we get straight alpha.
9031a23 to
43f4d9e
Compare
| // readPixels() handles converting pixels to premultiplied form. | ||
| bitmap->readPixels(premul_bitmap->pixmap()); | ||
| premul_bitmap->setImmutable(); | ||
| bitmap_allocator = premul_allocator; | ||
| bitmap = premul_bitmap; | ||
| } |
There was a problem hiding this comment.
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!
jonahwilliams
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
…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
Fixes flutter/flutter#151210 by premultiplying alpha in the rare case we get straight alpha.