[webkit-reviews] review granted: [Bug 212366] Extended Color Cleanup: Remove red()/green()/blue() accessors from ExtendedColor in preperation for supporting non-RGB based ColorSpaces : [Attachment 400250] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue May 26 10:41:22 PDT 2020


Simon Fraser (smfr) <simon.fraser at apple.com> has granted Sam Weinig
<sam at webkit.org>'s request for review:
Bug 212366: 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

Attachment 400250: Patch

https://bugs.webkit.org/attachment.cgi?id=400250&action=review




--- Comment #5 from Simon Fraser (smfr) <simon.fraser at apple.com> ---
Comment on attachment 400250
  --> https://bugs.webkit.org/attachment.cgi?id=400250
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.


More information about the webkit-reviews mailing list