RESOLVED FIXED 221676
Returning sRGB from CG color space functions on failure is too error prone
https://bugs.webkit.org/show_bug.cgi?id=221676
Summary Returning sRGB from CG color space functions on failure is too error prone
Sam Weinig
Reported 2021-02-10 08:35:28 PST
Returning sRGB from CG color space functions on failure is too error prone. We know at compile time what color spaces we support, so we should use HAVE() macros and remove the weirdness.
Attachments
Patch (17.02 KB, patch)
2021-02-10 08:45 PST, Sam Weinig
darin: review+
Patch (17.12 KB, patch)
2021-02-11 08:25 PST, Sam Weinig
no flags
Sam Weinig
Comment 1 2021-02-10 08:45:24 PST
Darin Adler
Comment 2 2021-02-10 16:05:53 PST
Comment on attachment 419849 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=419849&action=review > Source/WebCore/platform/graphics/cg/ColorSpaceCG.h:120 > +// NOTE: This function is guarenteed to return non-null, unlike cachedNullableCGColorSpace(). Seems mysterious to not say *why* it’s guaranteed. The subtle difference between DestinationColorSpace and ColorSpace. I’d say something like, "Since this is for *destination* color spaces, this function is ..." Also, the word guaranteed is misspelled!
Darin Adler
Comment 3 2021-02-10 16:06:26 PST
Why all the Mac API test failures?
Sam Weinig
Comment 4 2021-02-10 17:18:08 PST
(In reply to Darin Adler from comment #2) > Comment on attachment 419849 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=419849&action=review > > > Source/WebCore/platform/graphics/cg/ColorSpaceCG.h:120 > > +// NOTE: This function is guarenteed to return non-null, unlike cachedNullableCGColorSpace(). > > Seems mysterious to not say *why* it’s guaranteed. The subtle difference > between DestinationColorSpace and ColorSpace. I’d say something like, "Since > this is for *destination* color spaces, this function is ..." > > Also, the word guaranteed is misspelled! The only thing guaranteed in this world is that I will misspell "guaranteed".
Sam Weinig
Comment 5 2021-02-11 08:22:37 PST
(In reply to Darin Adler from comment #3) > Why all the Mac API test failures? Looks like it was an issue elsewhere. Re-running them fixed it.
Sam Weinig
Comment 6 2021-02-11 08:25:29 PST
EWS
Comment 7 2021-02-11 09:44:02 PST
Committed r272736: <https://commits.webkit.org/r272736> All reviewed patches have been landed. Closing bug and clearing flags on attachment 419990 [details].
Radar WebKit Bug Importer
Comment 8 2021-02-11 09:45:30 PST
Note You need to log in before you can comment on or make changes to this bug.