Summary: | Sampled Page Top Color: support sampling non-RGB values like P3 | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Devin Rousso <hi> | ||||
Component: | New Bugs | Assignee: | Devin Rousso <hi> | ||||
Status: | NEW --- | ||||||
Severity: | Normal | CC: | ews-watchlist, hi, joepeck, sam, thorton, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=225167 https://bugs.webkit.org/show_bug.cgi?id=226730 |
||||||
Bug Depends on: | 224987 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
Devin Rousso
2021-05-18 16:45:32 PDT
Created attachment 429691 [details]
Patch
Comment on attachment 429691 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429691&action=review > Source/WebCore/page/PageColorSampler.cpp:111 > +#if ENABLE(DESTINATION_COLOR_SPACE_DISPLAY_P3) > + auto colorSpace = DestinationColorSpace::DisplayP3(); > + using PixelBufferColorType = DisplayP3<uint8_t>; > + using SampleColorType = DisplayP3<float>; > +#else > + auto colorSpace = DestinationColorSpace::SRGB(); > + using PixelBufferColorType = SRGBA<uint8_t>; > + using SampleColorType = SRGBA<float>; > +#endif This seems a bit surprising to be hardcoded (and by a compile time flag no less!), shouldn't it follow the actual destination colorspace? Comment on attachment 429691 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429691&action=review >> Source/WebCore/page/PageColorSampler.cpp:111 >> +#endif > > This seems a bit surprising to be hardcoded (and by a compile time flag no less!), shouldn't it follow the actual destination colorspace? Are you suggesting like some sort of `colorTypeFromColorSpace`? AFAIK that isn't a thing we have right now. Can you elaborate more a bit on what you mean? Comment on attachment 429691 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429691&action=review >>> Source/WebCore/page/PageColorSampler.cpp:111 >>> +#endif >> >> This seems a bit surprising to be hardcoded (and by a compile time flag no less!), shouldn't it follow the actual destination colorspace? > > Are you suggesting like some sort of `colorTypeFromColorSpace`? AFAIK that isn't a thing we have right now. Can you elaborate more a bit on what you mean? No, I meant picking a color space compile-time is weird, when you should really be using the one that the owning view will render with! What if it's wider than P3? Let's see what Sam says. Comment on attachment 429691 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429691&action=review >>>> Source/WebCore/page/PageColorSampler.cpp:111 >>>> +#endif >>> >>> This seems a bit surprising to be hardcoded (and by a compile time flag no less!), shouldn't it follow the actual destination colorspace? >> >> Are you suggesting like some sort of `colorTypeFromColorSpace`? AFAIK that isn't a thing we have right now. Can you elaborate more a bit on what you mean? > > No, I meant picking a color space compile-time is weird, when you should really be using the one that the owning view will render with! What if it's wider than P3? Let's see what Sam says. FYI right now `DestinationColorSpace` only supports sRGB, Linear sRGB, and P3. (In reply to Devin Rousso from comment #6) > Comment on attachment 429691 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=429691&action=review > > >>>> Source/WebCore/page/PageColorSampler.cpp:111 > >>>> +#endif > >>> > >>> This seems a bit surprising to be hardcoded (and by a compile time flag no less!), shouldn't it follow the actual destination colorspace? > >> > >> Are you suggesting like some sort of `colorTypeFromColorSpace`? AFAIK that isn't a thing we have right now. Can you elaborate more a bit on what you mean? > > > > No, I meant picking a color space compile-time is weird, when you should really be using the one that the owning view will render with! What if it's wider than P3? Let's see what Sam says. > > FYI right now `DestinationColorSpace` only supports sRGB, Linear sRGB, and > P3. 1) Is it chosen at compile time? 2) Do you think if someone adds one, they'll fix your code? Comment on attachment 429691 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=429691&action=review >>>>>> Source/WebCore/page/PageColorSampler.cpp:111 >>>>>> +#endif >>>>> >>>>> This seems a bit surprising to be hardcoded (and by a compile time flag no less!), shouldn't it follow the actual destination colorspace? >>>> >>>> Are you suggesting like some sort of `colorTypeFromColorSpace`? AFAIK that isn't a thing we have right now. Can you elaborate more a bit on what you mean? >>> >>> No, I meant picking a color space compile-time is weird, when you should really be using the one that the owning view will render with! What if it's wider than P3? Let's see what Sam says. >> >> FYI right now `DestinationColorSpace` only supports sRGB, Linear sRGB, and P3. > > 1) Is it chosen at compile time? > 2) Do you think if someone adds one, they'll fix your code? DestinationColorSpace can support all color spaces. Like Tim said, this should use the color space the hosting view is using. |