WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
225942
Sampled Page Top Color: support sampling non-RGB values like P3
https://bugs.webkit.org/show_bug.cgi?id=225942
Summary
Sampled Page Top Color: support sampling non-RGB values like P3
Devin Rousso
Reported
2021-05-18 16:45:32 PDT
.
Attachments
Patch
(33.18 KB, patch)
2021-05-25 14:01 PDT
,
Devin Rousso
hi
: review?
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2021-05-18 16:46:16 PDT
<
rdar://problem/78179713
>
Devin Rousso
Comment 2
2021-05-25 14:01:26 PDT
Created
attachment 429691
[details]
Patch
Tim Horton
Comment 3
2021-05-25 14:53:10 PDT
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?
Devin Rousso
Comment 4
2021-05-25 15:02:28 PDT
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?
Tim Horton
Comment 5
2021-05-25 15:10:50 PDT
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.
Devin Rousso
Comment 6
2021-05-25 15:13:19 PDT
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.
Tim Horton
Comment 7
2021-05-25 15:17:27 PDT
(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?
Sam Weinig
Comment 8
2021-05-25 16:16:16 PDT
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.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug