-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove explicit clamp to SRGB for Lab colors on CG platforms that sup…
…port wide color https://bugs.webkit.org/show_bug.cgi?id=220684 Reviewed by Simon Fraser. LayoutTests/imported/w3c: Update existing lab/lch tests to match new more precise values from web-platform-tests/wpt#27202 and add two new tests for colors outside the sRGB gamut that will be upstreamed to WPT after landing. * web-platform-tests/css/css-color/lab-001.html: * web-platform-tests/css/css-color/lab-002.html: * web-platform-tests/css/css-color/lab-003.html: * web-platform-tests/css/css-color/lab-004-expected.html: * web-platform-tests/css/css-color/lab-004.html: * web-platform-tests/css/css-color/lab-005-expected.html: * web-platform-tests/css/css-color/lab-005.html: * web-platform-tests/css/css-color/lab-006-expected.html: * web-platform-tests/css/css-color/lab-006.html: * web-platform-tests/css/css-color/lab-007-expected.html: * web-platform-tests/css/css-color/lab-007.html: * web-platform-tests/css/css-color/lab-008-expected.html: Added. * web-platform-tests/css/css-color/lab-008.html: Added. * web-platform-tests/css/css-color/lch-001.html: * web-platform-tests/css/css-color/lch-002.html: * web-platform-tests/css/css-color/lch-003.html: * web-platform-tests/css/css-color/lch-004-expected.html: * web-platform-tests/css/css-color/lch-004.html: * web-platform-tests/css/css-color/lch-005-expected.html: * web-platform-tests/css/css-color/lch-005.html: * web-platform-tests/css/css-color/lch-006-expected.html: * web-platform-tests/css/css-color/lch-006.html: * web-platform-tests/css/css-color/lch-007-expected.html: * web-platform-tests/css/css-color/lch-007.html: * web-platform-tests/css/css-color/lch-008-expected.html: Added. * web-platform-tests/css/css-color/lch-008.html: Added. Source/WebCore: To avoid clamping device independent colors to sRGB we convert colors without a direct CoreGraphics representation to ExtendedSRGB to ensure the full gamut is preserved. While CoreGraphics does support the Lab colorspace on some systems (Big Sur and later), to ensure all versions of WebKit can support wide color Lab this approach provides the most coverage. * platform/graphics/ColorConversion.cpp: * platform/graphics/ColorConversion.h: * platform/graphics/ColorTypes.h: Add support for ExtendedSRGBA and LinearExtendedSRGBA color types. * platform/graphics/cg/ColorCG.cpp: (WebCore::leakCGColor): Update fallback conversion to convert to an extended color space to avoid premature clamping. Canonical link: https://commits.webkit.org/233219@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@271712 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Sam Weinig
committed
Jan 21, 2021
1 parent
1cc6052
commit 2ebcb2f
Showing
32 changed files
with
377 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lab-008-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Color 4: Specifying Lab and LCH</title> | ||
<style> | ||
.test { background-color: color(display-p3 0 1 0); width: 12em; height: 12em; } | ||
</style> | ||
<body> | ||
<p>Test passes if you see a single square, and not two rectangles of different colors.</p> | ||
<p class="test"> </p> | ||
</body> |
16 changes: 16 additions & 0 deletions
16
LayoutTests/imported/w3c/web-platform-tests/css/css-color/lab-008.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>CSS Color 4: Specifying Lab and LCH</title> | ||
<link rel="help" href="https://drafts.csswg.org/css-color-4/#specifying-lab-lch"> | ||
<link rel="match" href="lab-008-ref.html"> | ||
<meta name="assert" content="lab() outside the sRGB gamut"> | ||
<style> | ||
.test { background-color: red; width: 12em; height: 6em; margin-top:0} | ||
.ref { background-color: color(display-p3 0 1 0); width: 12em; height: 6em; margin-bottom: 0; } | ||
.test { background-color: lab(86.6146% -106.5599 102.8717); } | ||
</style> | ||
<body> | ||
<p>Test passes if you see a single square, and not two rectangles of different colors.</p> | ||
<p class="ref"> </p> | ||
<p class="test"> </p> | ||
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.