WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
223165
Match other browsers by interpolating colors in floating point space rather than uint8_t space
https://bugs.webkit.org/show_bug.cgi?id=223165
Summary
Match other browsers by interpolating colors in floating point space rather t...
Sam Weinig
Reported
2021-03-14 13:08:04 PDT
Match other browsers by interpolating colors in floating point space rather than uint8_t space
Attachments
Patch
(58.46 KB, patch)
2021-03-14 13:45 PDT
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Sam Weinig
Comment 1
2021-03-14 13:45:17 PDT
Created
attachment 423133
[details]
Patch
Sam Weinig
Comment 2
2021-03-14 14:09:07 PDT
Comment hidden (obsolete)
This does seem to fix WPT results, though I am curious if there is a way to do this and stay in uint8_t space using more clever rounding. For each color channel, we are doing: premultiplication: float: color.red = color.red * color.alpha uint8_t: color.red = static_cast<uint8_t>(fastDivideBy255(color.red * color.alpha + 254)) blending: float: from + (to - from) * progress uint8_t: static_cast<int>(lround(static_cast<double>(from) + static_cast<double>(to - from) * progress)) unpremultiplication: float: color.red = color.red / color.alpha uint8_t: color.red = static_cast<uint8_t>((fastMultiplyBy255(color.red) + color.alpha - 1) / color.alpha)
EWS
Comment 3
2021-03-14 23:20:08 PDT
Committed
r274408
: <
https://commits.webkit.org/r274408
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 423133
[details]
.
Radar WebKit Bug Importer
Comment 4
2021-03-14 23:21:14 PDT
<
rdar://problem/75419227
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug