Extended Color Cleanup: Remove red()/green()/blue() accessors from ExtendedColor in preperation for supporting non-RGB based ColorSpaces
Created attachment 400229 [details] Patch
Created attachment 400230 [details] Patch
Created attachment 400245 [details] Patch
Created attachment 400250 [details] Patch
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.
(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.
Committed r262151: <https://trac.webkit.org/changeset/262151> All reviewed patches have been landed. Closing bug and clearing flags on attachment 400250 [details].
<rdar://problem/63631217>