RESOLVED FIXED212366
Extended Color Cleanup: Remove red()/green()/blue() accessors from ExtendedColor in preperation for supporting non-RGB based ColorSpaces
https://bugs.webkit.org/show_bug.cgi?id=212366
Summary Extended Color Cleanup: Remove red()/green()/blue() accessors from ExtendedCo...
Sam Weinig
Reported 2020-05-25 20:43:53 PDT
Extended Color Cleanup: Remove red()/green()/blue() accessors from ExtendedColor in preperation for supporting non-RGB based ColorSpaces
Attachments
Patch (11.10 KB, patch)
2020-05-25 20:52 PDT, Sam Weinig
no flags
Patch (11.08 KB, patch)
2020-05-25 21:27 PDT, Sam Weinig
no flags
Patch (15.88 KB, patch)
2020-05-26 07:59 PDT, Sam Weinig
no flags
Patch (15.89 KB, patch)
2020-05-26 08:31 PDT, Sam Weinig
no flags
Sam Weinig
Comment 1 2020-05-25 20:52:44 PDT Comment hidden (obsolete)
Sam Weinig
Comment 2 2020-05-25 21:27:03 PDT Comment hidden (obsolete)
Sam Weinig
Comment 3 2020-05-26 07:59:58 PDT Comment hidden (obsolete)
Sam Weinig
Comment 4 2020-05-26 08:31:47 PDT
Simon Fraser (smfr)
Comment 5 2020-05-26 10:41:22 PDT
Comment on attachment 400250 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=400250&action=review > Source/WebCore/platform/graphics/ExtendedColor.cpp:91 > +bool ExtendedColor::isWhite() const > +{ > + auto [c1, c2, c3, alpha] = channels(); > + return c1 == 1 && c2 == 1 && c3 == 1 && alpha == 1; > +} > + > +bool ExtendedColor::isBlack() const > +{ > + auto [c1, c2, c3, alpha] = channels(); > + return !c1 && !c2 && !c3 && alpha == 1; > } These will be wrong for some non-RGB colorspaces, but we don't have any yet.
Sam Weinig
Comment 6 2020-05-26 10:53:02 PDT
(In reply to Simon Fraser (smfr) from comment #5) > Comment on attachment 400250 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=400250&action=review > > > Source/WebCore/platform/graphics/ExtendedColor.cpp:91 > > +bool ExtendedColor::isWhite() const > > +{ > > + auto [c1, c2, c3, alpha] = channels(); > > + return c1 == 1 && c2 == 1 && c3 == 1 && alpha == 1; > > +} > > + > > +bool ExtendedColor::isBlack() const > > +{ > > + auto [c1, c2, c3, alpha] = channels(); > > + return !c1 && !c2 && !c3 && alpha == 1; > > } > > These will be wrong for some non-RGB colorspaces, but we don't have any yet. Right, that's why I moved it to ExtendedColor. So that when we have Lab (or whatever) we have a single place to implement all these predicates.
EWS
Comment 7 2020-05-26 10:56:38 PDT
Committed r262151: <https://trac.webkit.org/changeset/262151> All reviewed patches have been landed. Closing bug and clearing flags on attachment 400250 [details].
Radar WebKit Bug Importer
Comment 8 2020-05-26 10:57:15 PDT
Note You need to log in before you can comment on or make changes to this bug.