Bug 235034

Summary: Use the new template ColorSpaceCG helpers to cleanup some code
Product: WebKit Reporter: Sam Weinig <sam>
Component: New BugsAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: darin, heycam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Sam Weinig 2022-01-10 10:16:52 PST
Use the new template ColoreSpaceCG helpers to cleanup some code
Comment 1 Sam Weinig 2022-01-10 11:14:08 PST
Created attachment 448778 [details]
Patch
Comment 2 Sam Weinig 2022-01-10 11:34:23 PST
Created attachment 448781 [details]
Patch
Comment 3 Sam Weinig 2022-01-10 15:16:54 PST
Created attachment 448805 [details]
Patch
Comment 4 Cameron McCormack (:heycam) 2022-01-10 18:18:22 PST
Comment on attachment 448805 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=448805&action=review

> Source/WebCore/platform/graphics/cg/GradientRendererCG.cpp:511
> +    using OutputSpaceColorType = std::conditional_t<HasCGColorSpaceMapping<ColorSpace::ExtendedSRGB>, ExtendedSRGBA<float>, SRGBA<float>>;

Since this declaration to choose "ExtendedSRGB if supported else SRGB" is used in a bunch of places, maybe it should be in CGColorSpace.h? Maybe a templated using statement (so float is still specified explicitly)?
Comment 5 Sam Weinig 2022-01-11 10:39:33 PST
(In reply to Cameron McCormack (:heycam) from comment #4)
> Comment on attachment 448805 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=448805&action=review
> 
> > Source/WebCore/platform/graphics/cg/GradientRendererCG.cpp:511
> > +    using OutputSpaceColorType = std::conditional_t<HasCGColorSpaceMapping<ColorSpace::ExtendedSRGB>, ExtendedSRGBA<float>, SRGBA<float>>;
> 
> Since this declaration to choose "ExtendedSRGB if supported else SRGB" is
> used in a bunch of places, maybe it should be in CGColorSpace.h? Maybe a
> templated using statement (so float is still specified explicitly)?

Sounds like a good idea.
Comment 6 EWS 2022-01-11 10:44:41 PST
Committed r287889 (245928@main): <https://commits.webkit.org/245928@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 448805 [details].
Comment 7 Radar WebKit Bug Importer 2022-01-11 10:45:18 PST
<rdar://problem/87408048>