WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 233862
[CSS Color 5] Update color-mix() to support srgb-linear and alpha premultiplication
https://bugs.webkit.org/show_bug.cgi?id=233862
Summary
[CSS Color 5] Update color-mix() to support srgb-linear and alpha premultipli...
Sam Weinig
Reported
2021-12-05 09:48:19 PST
Color interpolation has been updated to allow interpolation in the srgb-linear space and been clarified that mixing happens with alpha premultiplied colors.
Attachments
Patch
(116.96 KB, patch)
2021-12-05 10:06 PST
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
Patch
(117.08 KB, patch)
2021-12-06 05:47 PST
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
Patch
(117.02 KB, patch)
2021-12-06 07:54 PST
,
Sam Weinig
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Sam Weinig
Comment 1
2021-12-05 10:06:13 PST
Created
attachment 445988
[details]
Patch
Cameron McCormack (:heycam)
Comment 2
2021-12-05 19:34:23 PST
Comment on
attachment 445988
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=445988&action=review
I didn't look at the test changes closely.
> Source/WebCore/platform/graphics/ColorInterpolation.h:282 > + WebCore::ColorInterpolationColorSpace::SRGB, > + WebCore::ColorInterpolationColorSpace::XYZD50,
Missing SRGBLinear.
> Source/WebCore/platform/graphics/ColorNormalization.h:64 > +template<typename ComponentType> inline ComponentType normalizeHue(ComponentType hue) > +{ > + return std::fmod(std::fmod(hue, 360.0) + 360.0, 360.0); > +}
Do we want to try to stick to floats and use fmodf when ComponentType is a float?
Sam Weinig
Comment 3
2021-12-06 05:47:51 PST
Created
attachment 446034
[details]
Patch
Sam Weinig
Comment 4
2021-12-06 07:54:06 PST
Created
attachment 446038
[details]
Patch
Sam Weinig
Comment 5
2021-12-06 07:55:50 PST
(In reply to Cameron McCormack (:heycam) from
comment #2
)
> Comment on
attachment 445988
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=445988&action=review
> > I didn't look at the test changes closely. > > > Source/WebCore/platform/graphics/ColorInterpolation.h:282 > > + WebCore::ColorInterpolationColorSpace::SRGB, > > + WebCore::ColorInterpolationColorSpace::XYZD50, > > Missing SRGBLinear.
Fixed.
> > > Source/WebCore/platform/graphics/ColorNormalization.h:64 > > +template<typename ComponentType> inline ComponentType normalizeHue(ComponentType hue) > > +{ > > + return std::fmod(std::fmod(hue, 360.0) + 360.0, 360.0); > > +} > > Do we want to try to stick to floats and use fmodf when ComponentType is a > float?
This would subtly change the output of mixing to not be consistent with parsing (which uses doubles in normalization currently). We probably need to think about the use of doubles in the parsing code and decide where the appropriate point to cast down to float is and apply that holistically. Thanks for the review.
EWS
Comment 6
2021-12-06 13:58:30 PST
Committed
r286568
(?): <
https://commits.webkit.org/r286568
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 446038
[details]
.
Radar WebKit Bug Importer
Comment 7
2021-12-06 13:59:21 PST
<
rdar://problem/86122341
>
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